apollographql / apollo-rs

Spec compliant GraphQL Tools in Rust.
Apache License 2.0
576 stars 45 forks source link

feat(parser, compiler): add parsing a type reference from a string #718

Closed lrlna closed 12 months ago

lrlna commented 1 year ago

To parse standalone source text like [Type]!, for example for the federation directive @fields(type:).

closes #715

goto-bus-stop commented 1 year ago

Also Also Also, should this just be parsing into a Type directly instead of into a FieldType wrapper? A type reference doesn't have to be in a field, field/directive argument types are the same.

SimonSapin commented 1 year ago

Agree on both points: this can use ast::Type without introducing a FieldType struct, and the Ok result doesn’t need to contain diagnostics (or conversely, return Err if any diagnostic)

goto-bus-stop commented 12 months ago

It accepts [[String] (unclosed List) 🤔

goto-bus-stop commented 12 months ago

@SimonSapin Ready for review again I think!