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

Mutations not compiling: Option.Option_unwrap_error #44

Open
jessep opened this issue Jul 6, 2018 · 3 comments
Open

Mutations not compiling: Option.Option_unwrap_error #44

jessep opened this issue Jul 6, 2018 · 3 comments
Labels

Comments

@jessep
Copy link

jessep commented Jul 6, 2018

I'm getting some inscrutable errors. When I paste the following example from the README:

module SignUpQuery = [%graphql
  {|
mutation($name: String!, $email: String!, $password: String!) {
  signUp(email: $email, email: $email, password: $password) @bsVariant {
    user {
      name
    }

    errors {
      field
      message
    }
  }
}
|}
];

I get the following output:

>>>> Start compiling
Rebuilding since [ [ 'change', 'Query.re' ] ]
ninja: Entering directory `lib/bs'
[1/2] Building client/src/Query.mlast
FAILED: client/src/Query.mlast
/Users/jessep/Dropbox/Code/movement/node_modules/bs-platform/lib/bsc.exe -pp "/Users/jessep/Dropbox/Code/movement/node_modules/bs-platform/lib/refmt.exe --print binary" -ppx '/Users/jessep/Dropbox/Code/movement/node_modules/bs-platform/lib/reactjs_jsx_ppx_2.exe'  -ppx /Users/jessep/Dropbox/Code/movement/node_modules/graphql_ppx/ppx -w -30-40+6+7+27+32..39+44+45+101 -bs-suffix -nostdlib -I '/Users/jessep/Dropbox/Code/movement/node_modules/bs-platform/lib/ocaml' -no-alias-deps -color always -c -o client/src/Query.mlast -bs-syntax-only -bs-binary-ast -impl /Users/jessep/Dropbox/Code/movement/client/src/Query.re
Option.Option_unwrap_error
File "/Users/jessep/Dropbox/Code/movement/client/src/Query.re", line 1, characters 0-0:
Error: Error while running external preprocessor
Command line: /Users/jessep/Dropbox/Code/movement/node_modules/graphql_ppx/ppx '/var/folders/5x/w6vwvtzn1ts97f42_0kf74200000gn/T/camlppx803ef4' '/var/folders/5x/w6vwvtzn1ts97f42_0kf74200000gn/T/camlppx4a607c'

ninja: error: rebuilding 'build.ninja': subcommand failed
>>>> Finish compiling(exit: 1)

I have no idea what to do here. Here are versions of bs-platform and graphql_ppx From my package.json

 "bs-platform": "^3.1.5",
  "graphql_ppx": "^0.2.4"
@jessep
Copy link
Author

jessep commented Jul 6, 2018

I should also mention that non-mutation queries seem to work as expected.

@mhallin
Copy link
Owner

mhallin commented Jul 7, 2018

What does your schema look like; does it contain a signUp mutation with those fields?

It's definitely a bug that the error message is an Option_unwrap_error, so I'm a bit curious as to how your schema looks to produce this bug.

@mhallin mhallin added the bug label Jul 7, 2018
@jessep
Copy link
Author

jessep commented Jul 8, 2018

It was in fact related to the schema. I didn't have any mutations defined in the schema, and was confused because all sorts of other stuff that wasn't in the schema was still giving me proper errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants