Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request body generation is wrong when the parameter name is 'input' #233

Open
mohamedveron opened this issue Aug 3, 2021 · 3 comments
Open

Comments

@mohamedveron
Copy link

when creating a mutaion and tried to test it it always generate the request body with wrong object, after deep debugging I found that the issue was that i named the parameter with 'input' like that

    createAccount(input: $account){
        id,
        user{
            name,
        },
        amount
    }
} ```

when I changed it to another name it worked correctly:

``` mutation AccountConformationMutation($account: NewAccount!) {
    createAccount(account: $account){
        id,
        user{
            name,
        },
        amount
    }
} ```
@smkhalsa
Copy link
Member

smkhalsa commented Aug 4, 2021

Just to be clear, you changed the name of your parameter in your graphql server?

@mohamedveron
Copy link
Author

mohamedveron commented Aug 4, 2021

Just to be clear, you changed the name of your parameter in your graphql server?

Yes, It has to be changed in the schema of server also, but the problem in the generated code of ferry, specifically in the request of the schema in the client, it is generated in the wrong way because there is a conflict with the 'input' word with the generated code.

@smkhalsa
Copy link
Member

smkhalsa commented Sep 1, 2021

@mohamedveron does gql-dart/gql#264 solve the issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants