Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Basic idea here is that Grats can generate a special type which can be passed to Pothos such that you can use Pothos' add schema plugin to combine Grats and Pothos into a single schema while retaining type-safety.
Example usage:
While Grats' approach is very attractive for most common cases, it's lack of access to runtime data can be limiting in terms of the abstractions that can be built. Conversely, Pothos has excellent support for many useful runtime abstractions and a large existing ecosystem. Maybe it's possible to have the best of both worlds, using the right tool for the job on a type-by-type basis?
Rather than trying to add a a runtime layer to Grats which would fight its design goals and requrie re-invent those abstractions, could we build a bridge to Pothos and let the two play together? This could also, in theory allow Pothos users to incrementally adopt Grats or just use it in a few places where it make sense while still relying on Pothos for useful plugins and other integrations.
TODO
The Pothos add schema plugin may not be quite sufficient for our needs here since it has type granularity. It's not possible to define a type in Grats and then extend it with a field defined with Pothos (though the API exists and is typesafe). It would in theory be possible to create a new plugin (or add a mode to the existing plugin) which merges types instead of clobbering them, but there would be some work involved in defining the semantics of how merging would work.