retro / graphql-builder

GraphQL client library for Clojure and ClojureScript
MIT License
184 stars 15 forks source link

library changing graphql mutation #7

Closed kurt-o-sys closed 6 years ago

kurt-o-sys commented 6 years ago

I have a graphql mutation query like this:

mutation update(
  $id: ID!,
  $description: String,
  $otherIds: [ID!]) {
  updateService(
    id: $id,
    description: $description,
    otherIds: $otherIds) {
    ...item
  }}

Running the query from the apollo in-browser graphiQL console, the mutation works fine. However, when I try to run it from my code, I get this error:

bundle.js:1 Uncaught (in promise) Error: GraphQL error: Variable '$otherIds' of type '[ID]' used in position expecting type '[ID!]'. (line 1, column xx):
mutation update($id: ID!, $description: String, $otherIds: [ID]) {
                                                       ^
 (line 2, column xx):
  update(id: $id, description: $description, otherIds: $otherIds) {

So it seems this library changes graphql types of db references from [ID!] to [ID], making queries fail...

retro commented 6 years ago

@kurt-o-sys Thank you for reporting this. v0.1.5 is out with the fix.

kurt-o-sys commented 6 years ago

thx for the very quick fix :100: