kevinbarabash / compiler

2 stars 0 forks source link

Infer TData and TVariables from `gql` tagged template literal #48

Open kevinbarabash opened 2 years ago

kevinbarabash commented 2 years ago

Given a GraphQL schema and a query/mutation defined using gql we should be able to infer the type of the response and variables (if any are required). Eventually, this could evolve in a plugin architecture for the type system. The key aspect is that the plugin is provide an inferred type based on a string. A more complicated plugin architecture would provide a way for it to also generate a set of constraints for any interpolated values. It could return these constraints in the form of a custom TFun for each call since the number of params would have to match the number of interpolated values.