0

I've been reading and trying alot of Stuff, but only using cURL as tools. Are there other ways run tests against an GraphQL endpoint?

So my problem is an mutation query with serveral variables. Here is part of my Shema:

type mutation {
  oneComponentTypeCollected(userID: String!, password: String!, pageID: Int!,
    Components: ComponentsInput!): Page
}
type Components {
  ComponentType: ComponentType!
    required: Int!
    collected: Int!
}
type ComponentsInput {
  id: String!
    collected: Int!
}
type Page {
  id: Int!
}

How do i call query the oneComponentCollected mutation? What is expected is to set the collected value to 1 of the Component "inkpad_blue"

I tried the Following:

Variable syntax:

{"query":"mutation($input:ComponentsInput!) {oneComponentTypeCollected(userID: \"asd\", password: \"asd\", pageID: 1, input:$input){id}}","variables":{"input":{"id":"Inkpad_blue","collected":1}}} 

as pure String:

mutation($input:ComponentsInput!) {oneComponentTypeCollected(userID: "asd", password: "asd", pageID: 1, input:$input){id}}

Both result in 500 HTTP errors.

1 Answer 1

1

I think your mutation should go like this

mutation{oneComponentTypeCollected(userID: "asd", password: "asd", pageID: 1, Components:{"id": "Inkpad_blue","collected": 1}){id}}

Try this in your graphiql

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.