[IDL] Support accepts_definitions functions in IDL #789
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.
In the DSL, the best way to customize parts of a GraphQL schema is with custom definitions.
It would be nice to have a similar feature for the IDL, why not use the same feature?
Shout out to @theorygeek for first suggesting the
parse -> apply -> remove
pipeline for extracting behavior from IDL descriptions.See to-dos and caveats below.
On this branch, these are equivalent:
Field
DSL
IDL
Type
DSL
IDL
Schema
DSL
IDL
Caveats
instance_eval
which is unsafe. This is ok for safe input, but it's a foot-gun if turn user input into a schema. I should lock down the parser a bit..to_definition
should include@
-definitions)GraphQL::Argument
forprepare:
handlers)instrument
-- find a new name for this@
, since it's already used for directives?