Skip to content

Error when same variable name but different type in the same file #408

Open
@Sytten

Description

@Sytten

In a graphql file, I have two mutations with $input as a variable, like:

mutation CreateProject($input: CreateProjectInput!) {
  createProject(input: $input) {
    ...
  }
}
mutation CreateScope($input: CreateScopeInput!) {
  createScope(input: $input) {
    ...
  }
}

When trying to execute the mutation CreateProject, I get the following error:

Response { data: None, errors: Some([Error { message: "Invalid value for argument \"input\", field \"allowlist\" of type \"CreateScopeInput\" is required but not provided", locations: Some([Location { line: 62, column: 15 }]), path: None, extensions: None }]) }

So basically you can't have two variable with the same name but different type in the same graphql file

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions