teamwalnut / graphql-ppx

GraphQL language primitives for ReScript/ReasonML written in ReasonML
https://graphql-ppx.com
MIT License
257 stars 53 forks source link

Introduce test for interface fragment on object type #261

Open Kingdutch opened 3 years ago

Kingdutch commented 3 years ago

If interface A is implemented by object B then a fragment F on A should be spreadable on a field returning object B. This is described in the spec under section 5.5.2.3.1.

This test shows that this fails if a field from the fragment is also selected in the top level selection. This is a valid use-case when a component lower in the tree requires the data and the component making the query does too.

jfrolich commented 3 years ago

Thanks! I think I made it too type-safe so this case raises an error. I'll look into how this can be addressed.