Skip to content
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

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

Merged
merged 17 commits into from
Nov 15, 2023

Conversation

lrlna
Copy link
Member

@lrlna lrlna commented Nov 2, 2023

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

closes #715

@lrlna lrlna added apollo-parser apollo-compiler issues/PRs pertaining to semantic analysis & validation labels Nov 2, 2023
@lrlna lrlna self-assigned this Nov 2, 2023
@lrlna lrlna marked this pull request as ready for review November 9, 2023 04:06
@goto-bus-stop
Copy link
Member

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
Copy link
Contributor

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

This comment was marked as resolved.

@goto-bus-stop goto-bus-stop assigned goto-bus-stop and unassigned lrlna Nov 14, 2023
@goto-bus-stop goto-bus-stop removed their request for review November 14, 2023 16:16
@goto-bus-stop
Copy link
Member

@SimonSapin Ready for review again I think!

@goto-bus-stop goto-bus-stop changed the title feat(parser, compiler): add field type parsing for types provided as part of @fields feat(parser, compiler): add parsing a type reference from a string Nov 14, 2023
Copy link
Contributor

@SimonSapin SimonSapin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes, then it looks great!

crates/apollo-compiler/src/parser.rs Outdated Show resolved Hide resolved
crates/apollo-parser/src/parser/mod.rs Outdated Show resolved Hide resolved
crates/apollo-parser/src/parser/mod.rs Outdated Show resolved Hide resolved
Co-authored-by: Simon Sapin <simon@apollographql.com>
Co-authored-by: Simon Sapin <simon@apollographql.com>
@goto-bus-stop goto-bus-stop enabled auto-merge (squash) November 15, 2023 11:48
@goto-bus-stop goto-bus-stop merged commit d0fca39 into main Nov 15, 2023
11 checks passed
@goto-bus-stop goto-bus-stop deleted the add-type-parsing branch November 15, 2023 11:50
This was referenced Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apollo-compiler issues/PRs pertaining to semantic analysis & validation apollo-parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add parsing support for Type
3 participants