-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parsing + validation support for FieldSet
scalars
#681
Comments
Validation is also needed:
I propose that:
|
FieldSet
scalarsFieldSet
scalars
I was thinking to go about slightly differently, which may simplify this design. I was hoping that This would allow us to not have a special validation method for just the selection set - the |
From some internal conversations, it seems like |
Fixed in #685 |
Apollo Federation has multiple directives that take an argument of type
FieldSet
to designate one or more fields of an object (or interface?) type.FieldSet
is a custom scalar serialized as a string. Its value is expected to be parsed as aSelectionSet
with optional outer brackets. (This is GraphQL syntax inside of a string in GraphQL syntax.)Currently apollo-rs can only parse GraphQL documents, but we’d rather Rust federation not need string concatenation hacks to create a parser input that looks like a document.
API sketch
In apollo-parser:
apollo_parser::SyntaxTree
aCst
type parameterapollo_parser::Parser::new(string).parse()
now returnsSyntaxTree<apollo_parser::cst::Document>
instead of justSyntaxTree
apollo_parser::Parser::new(string).parse_fieldset()
which returnsSyntaxTree<cst::SelectionSet>
SyntaxTree::document(self) -> cst::Document
method now only exists onSyntaxTree<cst::Document>
SyntaxTree::selection_set(self) -> cst::SelectionSet
forSyntaxTree<cst::SelectionSet>
In apollo-compiler:
Parser
method with the same signatureThe text was updated successfully, but these errors were encountered: