haskell-graphql / graphql-api

Write type-safe GraphQL services in Haskell
BSD 3-Clause "New" or "Revised" License
406 stars 35 forks source link

Improve type safety on operation interpreting #214

Closed thiagorp closed 5 years ago

thiagorp commented 5 years ago

This is one of a series of PR's I am doing as small improvements that are suggesting on the code itself.

This constraints the resolving of the operation (or the root of the query) to only objects. Removing the unnecessary check that was done checking if the result of the resolving was indeed an object or not.

I want to implement schema introspection and for that I have been reading the code to understand where and how to add it. To be able to handle the __schema field, it's necessary a resolver that we are sure that is the entrypoint so we can build up the schema downwards from it. This change makes it possible.