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

Set up stubs for SchemaBlueprint #6772

Merged
merged 6 commits into from
Feb 19, 2025
Merged

Conversation

tninesling
Copy link
Contributor

@tninesling tninesling commented Feb 11, 2025

Begin porting blueprints from JS. The JS version extends FederationBlueprint from SchemaBlueprint. With this setup, we'll have to call the DefaultBlueprint from the FederationBlueprint in lieu of super.

Omitted validationRules(): readonly SDLValidationRule[] because apollo-rs doesn't allow passing in a set of rules to validate in the same way as graphql-js. Additionally, type signatures using GraphQLError or GraphQLError[] use FederationError, which can represent multiple errors. The JS code marks success with an empty error array, so I've used Result<(), FederationError> for GraphQLError[].

JS SchemaBlueprint: https://github.com/apollographql/federation/blob/main/internals-js/src/definitions.ts#L891
JS FederationBlueprint: https://github.com/apollographql/federation/blob/main/internals-js/src/federation.ts#L1549


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Tests added and passing3
    • Unit Tests
    • Integration Tests
    • Manual Tests

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

Copy link
Contributor

@tninesling, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

@tninesling tninesling requested review from clenfest and briannafugate408 and removed request for SimonSapin, goto-bus-stop and lrlna February 11, 2025 23:39
@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Feb 11, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: 1fb6886890b24bf2b93b82cb

@tninesling tninesling marked this pull request as draft February 11, 2025 23:49
@tninesling tninesling marked this pull request as ready for review February 12, 2025 23:21
…chema, and hooks that return GraphQLError[] in JS are represented as Result<(), FederationError> instead of Option<FederationError> to better indicate success/failure and enable ? chaining
@tninesling
Copy link
Contributor Author

General question: should we be operating on apollo_compiler::Schema here, apollo_federation::schema::FederationSchema, or is this where we'll introduce the staged schema type we talked about during the kickoff?

@tninesling tninesling merged commit 9c174ba into dev Feb 19, 2025
15 checks passed
@tninesling tninesling deleted the tninesling/federation-blueprints branch February 19, 2025 17:31
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.

3 participants