question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I am facing serious probelem, i am getting this error {message: "mutate() missing 1 required positional argument: 'file'",…}

See original GitHub issue

i 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:closed
  • Created 5 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
reaganscofieldcommented, Sep 4, 2018

@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

0reactions
davidroecacommented, Sep 3, 2018

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found