apollographql / apollo-rs

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

add parsing support for `Type` #715

Closed lrlna closed 12 months ago

lrlna commented 1 year ago

Similar to #681, @field directive can be provided with Type information in a string form, which will then need to be parsed before being used in the schema. It seems like it does not need to be validated specifically (but we should do it anyways)

To make this change, we need to:

  1. add parse_type method to apollo-parser
  2. add a cst::Type specific method for SyntaxTree implementation to return the CST node, similar to doc.document(), and field_set.field_set()
  3. create a parse_type method in apollo-compiler
  4. add Type struct to apollo-compiler's schema that would also be able to include BuildErrors
  5. add a parse and validate methods to the Type struct impl