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

Update schemaIsSubgraph to also support non nullable _Service.sdl #7274

Conversation

patrick91
Copy link
Contributor

@patrick91 patrick91 commented Dec 23, 2022

Related to apollographql/apollo-federation-subgraph-compatibility#302

We found a discrepancy in how libraries implement the federation specification (_Service.sdl is String in Federation 1 and is String in Federation 2).
I'm doing this PR mostly to check how easy it would be to support both specs at once, if I understood correctly the code schemaIsSubgraph might also be used outside Apollo Server 😊

@netlify
Copy link

netlify bot commented Dec 23, 2022

Deploy Preview for apollo-server-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 26f5e70
🔍 Latest deploy log https://app.netlify.com/sites/apollo-server-docs/deploys/63a5e01eaaaf720008a688de
😎 Deploy Preview https://deploy-preview-7274--apollo-server-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 23, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 26f5e70:

Sandbox Source
Apollo Server Typescript Configuration
Apollo Server Configuration

Copy link
Member

@trevor-scheer trevor-scheer left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the tests! Would you please add a changeset (run npx changeset)?

patrick91 and others added 2 commits December 23, 2022 16:49
@patrick91 patrick91 marked this pull request as ready for review December 23, 2022 16:50
@patrick91
Copy link
Contributor Author

@trevor-scheer thanks and done, let me know if I need to rebase :)

@trevor-scheer
Copy link
Member

@patrick91 until we release this, you're welcome to use the codesandbox ci builds (from the PR comment) to test out these changes or unblock other work in the meantime.

trevor-scheer added a commit that referenced this pull request Jan 13, 2023
Fed v2 updated the subgraph spec to make _Service.sdl non-nullable.
We should explain this thoroughly in our docs, test for both cases,
and update a relevant recent changelog entry. Follow-up to #7274.
trevor-scheer added a commit that referenced this pull request Jan 18, 2023
Fed v2 updated the subgraph spec to make `_Service.sdl` non-nullable. We
should explain this thoroughly in our docs, test for both cases, and
update a relevant recent changelog entry. Follow-up to #7274.

Addresses
#7274 (comment)
trevor-scheer pushed a commit that referenced this pull request Jan 19, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @apollo/server-integration-testsuite@4.3.1

### Patch Changes

- [#7285](#7285)
[`35fa72bdd`](35fa72b)
Thanks [@glasser](https://github.com/glasser)! - Adds an integration
test verifying that Rover's introspection query works. This should not
break any integration that passes other tests.

- [#7276](#7276)
[`15c912f4c`](15c912f)
Thanks [@renovate](https://github.com/apps/renovate)! - Update
graphql-http dependency

- Updated dependencies
\[[`ec28b4b33`](ec28b4b),
[`322b5ebbc`](322b5eb),
[`3b0ec8529`](3b0ec85)]:
    -   @apollo/server@4.3.1

## @apollo/server@4.3.1

### Patch Changes

- [#7313](#7313)
[`ec28b4b33`](ec28b4b)
Thanks [@vtipparam](https://github.com/vtipparam)! - Allow case
insensitive lookup on headers. Use HeaderMap instead of plain Map for
headers in expressMiddleware.

- [#7311](#7311)
[`322b5ebbc`](322b5eb)
Thanks [@axe-me](https://github.com/axe-me)! - Export intermediate
ApolloServerOptions\* types

- [#7274](#7274)
[`3b0ec8529`](3b0ec85)
Thanks [@patrick91](https://github.com/patrick91)! - The subgraph spec
has evolved in Federation v2 such that the type of
`_Service.sdl` (formerly nullable) is now non-nullable. Apollo Server
now
    detects both cases correctly in order to determine whether to:
    1.  install / enable the `ApolloServerPluginInlineTrace` plugin
2. throw on startup if `ApolloServerPluginSchemaReporting` should not be
installed
3. warn when `ApolloServerPluginUsageReporting` is installed and
configured with the `__onlyIfSchemaIsNotSubgraph` option

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 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.

None yet

3 participants