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

Is it possible to send graphql variables, like the input objects for mutations? #307

Open
x0y-gt opened this issue Mar 9, 2020 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@x0y-gt
Copy link

x0y-gt commented Mar 9, 2020

How can I accomplish this?

The query:

mutation user($user: CreateUserInput!) {
  createUser(input: $user) {
    user {
      id
      name
      email
    }
  }
}

And send the variables as an input obj:

{
  "user": {
    "name": "Sebas",
    "email": "bla@test...",
    "birthdate": "2001-01-01"
  }
}
@ariebovenberg
Copy link
Owner

Hi @x0y-gt thanks for creating this issue.

Variables and mutations are not yet supported. Also not yet in the upcoming release. It is on the backlog of course, but will take some time to be included.

Currently, it is possible to use variables in the Python code creating the queries, for example:

repo_name = "Hello-World"
schema.query[
  _
  .repository(owner='octocat', name=repo_name) [
    _
    .createdAt
  ]
]

The next release should smooth out some issues with input objects as well. Let me know if you run into other issues :).

@ariebovenberg ariebovenberg added enhancement New feature or request question Further information is requested labels Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants