captbaritone / grats

Implementation-First GraphQL for TypeScript
https://grats.capt.dev
MIT License
309 stars 16 forks source link

[RFC] Specify a directive syntax for encoding how to execute JavaScript resolvers #152

Open captbaritone opened 12 hours ago

captbaritone commented 12 hours ago

Talked with a potential Grats user who was asking if Grats could generate graphql-tools-style resolver maps instead of a GraphQL-js style GraphQLSchema. It's quite possible, but it got me thinking about a more explicit decoupling of the analysis that Grats does (what is your schema, and how do I execute it?) and tools that would make use of that analysis. I think there are some interesting possibilities if we can decouple those two things:

  1. Relay Resolves could consume schema defined with Grats
  2. Non-Grats tools could use Grat's codegen to build a GraphQLSchema
  3. Someone (this new user) could write their own tool to produce resolver maps from the analysis Grats does
  4. etc

This PR is a draft of that proposal for early feedback.

I'd be curious to hear thought on if this would be a valuable standard for people to be able to build to. If so, are there libraries/tools people have in mind that could be built? Any feedback on this initial draft?


Replaces #151. Structured as a PR to facilitate inline feedback.

netlify[bot] commented 12 hours ago

Deploy Preview for grats ready!

Name Link
Latest commit e2edacc773830db3012a099832aff591b146ef8e
Latest deploy log https://app.netlify.com/sites/grats/deploys/673cceef04b7a400081d9ebd
Deploy Preview https://deploy-preview-152--grats.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.