mhallin/graphql_ppx

trying to query array of scalars as object results in error

Coobaha opened this issue · 6 comments

example of query:

{
  arrayOfStrings: {
    id
  }
}

 There's been an error running a preprocessor before the compilation of a file.
  This was the command:

 ./node_modules/graphql_ppx/ppx '/var/folders/c1/v8_9j1yn65dcm4g1ltl9968h0000gn/T/camlppx4cafcc' '/var/folders/c1/v8_9j1yn65dcm4g1ltl9968h0000gn/T/camlppxf84920'

Hello!

That syntax has an invalid syntax. Was that the entire message you got from the compiler, or did it say anything else? It should say something like "Invalid token {" on the second line.

The correctly formed query would look something like

{
  arrayOfStrings {
    id
  }
}

@mhallin Sorry, you are right! I was typing this example by hand but error is from compiler with correct syntax

{
  arrayOfStrings {
    id
  }
}

So instead of saying that this is array of primitives compiler tries to find corresponding array of objects from schema and fails with error above.

Does the compiler say anything else? There's usually a message right before the "We've found a bug for you" line.

@mhallin
no,


  There's been an error running a preprocessor before the compilation of a file.
  This was the command:

  ./node_modules/graphql_ppx/ppx '/var/folders/c1/v8_9j1yn65dcm4g1ltl9968h0000gn/T/camlppx1272f6' '/var/folders/c1/v8_9j1yn65dcm4g1ltl9968h0000gn/T/camlppxe02017'

Alright, I've found the root cause. The error message will be fixed in the next release.