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

[Federation] Normalize SDL in a normalization step before validation #2771

Merged
merged 3 commits into from
Jun 5, 2019

Conversation

trevor-scheer
Copy link
Member

Currently, we perform transformations to normalize an individual
service's SDL during composition. One of the normalizations
(@extends directive) should actually be performed before validation
happens for simplicity.

The result of this realization was to pull out SDL normalization
into a separate step which happens before composition.

For now, normalization is two steps:

  • transform type Thing @extends ... to extend type Thing ...
  • transform root operations to their default names i.e. RootQuery to Query

This PR mostly moves things around (where the normalization functions live and their tests)

@trevor-scheer trevor-scheer requested a review from jbaxleyiii June 4, 2019 04:21
@trevor-scheer trevor-scheer changed the title Normalize SDL in a normalization step before validation [Federation] Normalize SDL in a normalization step before validation Jun 4, 2019
@trevor-scheer trevor-scheer requested a review from JakeDawkins June 4, 2019 18:16

type RootMutation {
keepThisField: String
removeThisField: Query
Copy link
Contributor

Choose a reason for hiding this comment

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

👏👏👏

Copy link
Contributor

@JakeDawkins JakeDawkins left a comment

Choose a reason for hiding this comment

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

Fantastic work 👏

@trevor-scheer trevor-scheer force-pushed the trevor/normalize-sdl branch from c8da5af to fdac729 Compare June 5, 2019 16:29
Currently, we perform transformations to normalize an individual
service's SDL during composition. One of the normalizations
(@extends directive) should actually be performed before validation
happens for simplicity.

The result of this realization was to pull out SDL normalization
into a separate step which happens before composition.
@trevor-scheer trevor-scheer force-pushed the trevor/normalize-sdl branch from ab0a99e to abb5d51 Compare June 5, 2019 16:44
@trevor-scheer trevor-scheer merged commit 0a9af35 into master Jun 5, 2019
@trevor-scheer trevor-scheer deleted the trevor/normalize-sdl branch June 5, 2019 17:00
abernix pushed a commit to apollographql/federation that referenced this pull request Sep 4, 2020
…pollographql/apollo-server#2771)

Currently, we perform transformations to normalize an individual
service's SDL during composition. One of the normalizations
(`@extends` directive) should actually be performed before
composition happens for simplicity.

The result of this realization was to pull out SDL normalization
into a separate step which happens before composition.

Noteworthy changes:
* Filter @extends directives after transforming to `extend type`
(they're extraneous)
* Perform schema normalizations before composition

Apollo-Orig-Commit-AS: apollographql/apollo-server@0a9af35
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants