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

Missing RootQuery import in generated objects #78

Closed
Munksgaard opened this issue Oct 31, 2018 · 2 comments
Closed

Missing RootQuery import in generated objects #78

Munksgaard opened this issue Oct 31, 2018 · 2 comments
Labels

Comments

@Munksgaard
Copy link

On elm-graphql@1.1.0 I'm getting errors about missing RootQuery types in my generated object files.

Here is my output:

$ elm make src/Project/Object/AuthenticatePayload.elm --output\=elm.js --debug
Detected errors in 1 module.                                         
-- NAMING ERROR ------------------ src/Project/Object/AuthenticatePayload.elm

I cannot find a `RootQuery` type:

42| query : SelectionSet decodesTo RootQuery -> Field (Maybe decodesTo) Project.Object.AuthenticatePayload
                                   ^^^^^^^^^
These names seem close though:

    Order
    Bool
    Never
    Result

Hint: Read <https://elm-lang.org/0.19.0/imports> to see how `import`
declarations work in Elm.

The workaround is to insert the following import:

import Graphql.Operation exposing (RootQuery)

But I'd really want to avoid doing that for all of my files. Besides, I'd prefer not to have to check the generated files into my git repository.

@Munksgaard
Copy link
Author

It seems like this only happens for mutations...

@dillonkearns
Copy link
Owner

This is fixed in NPM version 1.0.5 (see the changelog entry). Thank you for reporting the issue!

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