mhallin / graphql_ppx

GraphQL PPX rewriter for Bucklescript/ReasonML
BSD 3-Clause "New" or "Revised" License
320 stars 42 forks source link

Schema file not found #66

Open arnarthor opened 5 years ago

arnarthor commented 5 years ago

I'm trying to use the -schema parameter but I keep getting this error

Fatal error: exception Failure("graphql_ppx/ppx -schema=../shared/src/customerapi/graphql_schema.json not found when resolving ppx-flags")

No matter where I locate the schema file, it's always the same error. Having it as schema.json in the same folder as bsconfig also producec this error.

I've also tried it with graphql_ppx/ppx\\ -schema=... like mentioned for bs-platform 4.0.2 in #50.

Any ideas?

mhallin commented 5 years ago

Hello!

The file should be named graphql_schema.json. I will look into as to why specifying the filename does not work.

baldurh commented 5 years ago

@mhallin have you had the chance to look into this? 😬

idkjs commented 5 years ago

I have this which isnt working either:

  "ppx-flags": [
    "graphql_ppx/ppx\\ -schema=graphql_schema.json"
],
nirvdrum commented 5 years ago

@idkjs I spent a while this evening trying to work this out. As of BuckleScript 5.1.0, the following works for me:

"ppx-flags": [
    ["graphql_ppx/ppx", "-verbose", "-schema=lib/js/src/graphql/schema.json"]
  ],

I'm new to the ecosystem, so I'm not really sure when it broke or was fixed. It appears this one has ping-ponged a few times. It looks like the array of arguments is the syntax going forward though.