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

Incorrect graphql validation #11

Closed
MaximusMcCann opened this issue Oct 26, 2016 · 4 comments
Closed

Incorrect graphql validation #11

MaximusMcCann opened this issue Oct 26, 2016 · 4 comments

Comments

@MaximusMcCann
Copy link

image

Compared to GraphiQL

fragment _Pie on Pie {
  __typename
  id
  ... on SystemPie {
    isActive
  }
}

image

@MaximusMcCann
Copy link
Author

SystemPie and UserPie are of the interface type Pie.

The above also works in our current implementation.

@martijnwalraven
Copy link
Contributor

@MaximusMcCann: Could you include the relevant part of your schema?

apollo-codegen uses graphql-js for validation, so the results should be the same as GraphiQL. Validation rules may have changed depending on graphql-js versions however.

When you say this works in your current implementation, what setup are you describing?

@MaximusMcCann
Copy link
Author

The parser is incorrectly evaluating the SystemPie to a UserPie here.

Works in the sense that graphiql has no issues with determining the SystemPie has the isActive flag. We also query this in production and the isActive flag is returned when the item is a SystemPie.

Pie = Interface
UserPie implements Pie
SystemPie implements Pie

Unfortunately, cannot copy and paste a schema portion atm.

@martijnwalraven
Copy link
Contributor

I'm not sure what could be going on here, and without something reproducible (like part of a schema) it is difficult to investigate further.

apollo-codegen 0.9 updates graphql-js to the most recent version, so that might solve your issue. Could you give that a try and report back?

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

No branches or pull requests

2 participants