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: parse schema from SDL #3

Merged
merged 13 commits into from
Jun 5, 2024
Merged

feat: parse schema from SDL #3

merged 13 commits into from
Jun 5, 2024

Conversation

JoviDeCroock
Copy link
Contributor

@JoviDeCroock JoviDeCroock commented May 23, 2024

This is an initial implementation of the Schema Definition Language, currently this supports a schema like the following

scalar MyScalar

type Todo {
  id: ID!
  text: MyScalar
}

type Query {
  todo: Todo!
}

It misses two SDL functionalities

  • extending types
  • directive definitions

This includes an initial set of validations that still need testing

@JoviDeCroock JoviDeCroock force-pushed the add-sdl-parsing branch 4 times, most recently from fb7ff6c to d3ae0fc Compare May 23, 2024 18:05
@JoviDeCroock JoviDeCroock marked this pull request as ready for review May 25, 2024 06:09
src/schema/build_client_schema.rs Outdated Show resolved Hide resolved
src/schema/build_client_schema.rs Outdated Show resolved Hide resolved
@@ -154,7 +154,7 @@ pub enum IntrospectionInputTypeRef<'a> {
#[cfg_attr(feature = "json", derive(Deserialize, Serialize))]
#[cfg_attr(feature = "json", serde(rename_all = "camelCase"))]
pub struct IntrospectionNamedTypeRef<'a> {
#[cfg_attr(feature = "json", serde(skip))]
#[cfg_attr(feature = "json", serde(borrow))]
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you end up figuring out what's up here with the skips?

schema_interface.add_possible_type(ctx, obj);
}

// TODO: possible interfaces aren't conveyed in the introspection
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be post-processing to determine those? I' not sure what other SDL parsers do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possible interfaces actually doesn't exist in the reference implementation, not sure why we added that

@JoviDeCroock JoviDeCroock merged commit 79440ed into main Jun 5, 2024
1 check passed
@JoviDeCroock JoviDeCroock deleted the add-sdl-parsing branch June 5, 2024 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants