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

Fix __typename related test cases #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

farnoy
Copy link

@farnoy farnoy commented Aug 2, 2016

This fixes the two test cases related to typename.

Should we make __typename and other type-system related information explicit and required for object schemas?

I also had to change this line, because it is checking for ValueInt value for that argument.

-              hero(episode: EMPIRE) {
+              hero(episode: 5) {

Should we add stricter type-checking for our StarWars schema?

Forgive my lack of knowledge, I just started with GraphQL. The Javascript schema-definition API seems very explicit, maybe we should aim for that here as well?

@farnoy
Copy link
Author

farnoy commented Aug 2, 2016

Thinking some more about this... Maybe it would be a good idea to expose an API like Servant? We could encode more information with our schema, like what arguments are certain resolvers expecting, etc.

This could help with introspection in the future too.

@jdnavarro
Copy link
Owner

Mapping the GraphQL type system to Haskell's one is something that has come up before. It would really neat, but my position on this to have it working first at the value level, just like the JS reference implementation, before going into type level programming.

There might be some way to obtain something similar to what the GraphQL type system expects as type name from a given Haskell value with Data.Typeable or fiddling with Data.Proxy.

If it's too much trouble you can remove that test for now. Having to pass the __typename explicitly would be too cumbersome and wouldn't add that much type safety since you could lie too easily about the type 😄 .

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

Successfully merging this pull request may close these issues.

2 participants