I am facing serious probelem, i am getting this error {message: "mutate() missing 1 required positional argument: 'file'",…}
See original GitHub issuei have the following mutation code
import graphene
from graphene_file_upload import Upload
from graphene_django import DjangoObjectType
from .models import realEstateAgencies
class CreateAgency(graphene.Mutation):
id = graphene.UUID()
authorName = graphene.String()
authorEmail = graphene.String()
authorPhone = graphene.Int()
agencyName = graphene.String()
agencyAddress = graphene.String()
agencyLogo = Upload()
class Arguments:
authorName = graphene.String()
authorEmail = graphene.String()
authorPhone = graphene.Int()
agencyName = graphene.String()
agencyAddress = graphene.String()
agencyLogo = Upload()
def mutate(self, info, file, **kwargs):
authorName = kwargs.get('authorName')
authorEmail = kwargs.get('authorEmail')
authorPhone = kwargs.get('authorPhone')
agencyName = kwargs.get('agencyName')
agencyAddress = kwargs.get('agencyAddress')
agencyLogo = info.context.FILES.get(file)
actionCreate = realEstateAgencies(
authorName = authorName,
authorEmail = authorEmail,
authorPhone = authorPhone,
agencyName = agencyName,
agencyAddress = agencyAddress,
agencyLogo = agencyLogo
)
actionCreate.save()
return CreateAgency(
id = actionCreate.id
)
i am keeping getting the error i have even try to remove kwargs and leave only 3 parameraters and use info.context.get(‘otherData’) but still facing the problem
thanks in advance for help
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Missing 1 required positional argument - python - Stack Overflow
The error tells me that I need 1 more argument in the name, so I must be going wrong there, but I already...
Read more >Graphene Documentation - Read the Docs
An error will be thrown: TypeError: resolve_hello() missing 1 required positional argument: 'name'. You can fix this error in several ways.
Read more >FAQ: What's a reproducible example (`reprex`) and how do I ...
First shiny app - error message - missing argument ... Facing problem while writing the R code ... I can't use the plot...
Read more >Changelog — Python 3.11.1 documentation
save() method for LWPCookieJar and MozillaCookieJar : saved file was not truncated on repeated save. gh-99240: Fix double-free bug in Argument ...
Read more >Python missing 1 required positional argument: 'self' Solution
On Career Karma, learn about the Python missing 1 required positional argument: 'self' error, how the error works, and how to solve the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@davidroeca @japrogramer @lmcgartland
thank you all for all your help! i solve my probem. on my client i was using axios which does not support multi/partdata i have changed feom axios to apollo everything works well
thamk you again
More on topic though, @reaganscofield have you figured out what was going wrong? Trying out a simple curl as documented in the multipart request spec might help us diagnose the issue as well