-
Notifications
You must be signed in to change notification settings - Fork 51
Conversation
Given a scalar type dictionary and an AST node describing a type, return a GraphQLType | ||
definition, which applies to that type. For example, if provided the parsed AST node for | ||
`[Date]`, a GraphQLList instance will be returned, containing the type called | ||
"Date" found in the scalar type dictionary. If a type called "Date" is not found in the scalar | ||
type dictionary, then None will be returned. | ||
|
||
Note: this is very similar to GraphQL's type_from_ast. However, instead of requiring a GraphQL | ||
schema this function requires a dictionary of the scalar types. This simplifies deserialization | ||
and allows for custom scalar types without constructing an entire schema. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copying over this comment on #1008 from @obi1kenobi
Are we going to have issues with this approach if a provider wants to add some custom scalar types that the compiler doesn't natively support?
Not necessarily a deal-breaker, just want to make sure we consider the costs and benefits and explicitly choose the tradeoffs that are best here.
I think that yes, we will have an issue for custom scalar types not in the compiler. However, I'm not sure what the alternative is since we don't want deserialization to be dependent on the schema. Open to suggestions!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just document it for now as a limitation of the current approach, and revisit when we need more custom scalar types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple of nits.
Co-authored-by: Predrag Gruevski <[email protected]>
Co-authored-by: Predrag Gruevski <[email protected]>
Co-authored-by: Predrag Gruevski <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1013 +/- ##
==========================================
- Coverage 94.38% 93.25% -1.13%
==========================================
Files 113 114 +1
Lines 9088 9198 +110
==========================================
Hits 8578 8578
- Misses 510 620 +110
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Adds basic query planning type definitions including
SimpleExecute
.Part of the refactor in #1008