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

Parsing error when using fragments #52

Closed
tmattio opened this issue Aug 7, 2018 · 4 comments
Closed

Parsing error when using fragments #52

tmattio opened this issue Aug 7, 2018 · 4 comments
Labels
bug fixed in next release This issue has been resolved in the master branch and will be closed when the next release is cut

Comments

@tmattio
Copy link

tmattio commented Aug 7, 2018

I am trying to build a query with fragments, it looks like this:

module Fragments = [%graphql
  {|
    fragment documentFields on Document {
      sourceText
    }
  |}
];

module GetDataset = [%graphql
  {|
    query dataset($owner: String!, $name: String!) {
      dataset(name: $name, owner: $owner) {
        name
        dataType
        datapoints(first: 100) {
          edges {
            node {
              ...Fragments.DocumentFields @bsField(name: "document")
            }
          }
        }
      }
    }
  |}
];

Unfortunately, running this yields a GraphQLError: Syntax Error: Cannot parse the unexpected character ".".

Am I doing something wrong with the query?

@mhallin mhallin added bug fixed in next release This issue has been resolved in the master branch and will be closed when the next release is cut labels Aug 8, 2018
@mhallin
Copy link
Owner

mhallin commented Aug 8, 2018

Hello! This is indeed a bug in the query printer. I will make a release soon that will fix this.

@mhallin mhallin closed this as completed Aug 8, 2018
@tmattio
Copy link
Author

tmattio commented Aug 8, 2018

@mhallin Thanks for the quick answer!
Unfortunately, upgrading to 0.2.7 does not fix the error :/

@mhallin
Copy link
Owner

mhallin commented Aug 8, 2018

That's strange. Have you run bsb -clean-world -make-world to make sure that everything is recompiled with the new ppx?

@mhallin mhallin reopened this Aug 8, 2018
@tmattio
Copy link
Author

tmattio commented Aug 8, 2018

I didn't, cleaning the build solves the issue! Thanks a lot :)

@mhallin mhallin closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fixed in next release This issue has been resolved in the master branch and will be closed when the next release is cut
Projects
None yet
Development

No branches or pull requests

2 participants