Skip to content

Commit

Permalink
Remove deprecation warning
Browse files Browse the repository at this point in the history
It's a bit overkill. New plan is not to make "key but no ref" an error
in AS3 but just have it log a line noting that usage reporting is not
automatically installed.
  • Loading branch information
glasser committed May 27, 2021
1 parent c8c0748 commit 6396938
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ The version headers in this history reflect the versions of Apollo Server itself
## v2.25.0

- `apollo-server-core`: You may now specify your Studio graph as a graph ref (`id@variant`) via the `APOLLO_GRAPH_REF` environment variable or `new ApolloServer({apollo: {graphRef}})` instead of specifying graph ID and graph variant separately. The `apollo` object passed to plugin `serverWillStart` and to gateway `load` now contains a `graphRef` field.
- `apollo-server-core`: If you specify an Apollo key but do not specify a graph ID or graph ref, a deprecation warning is logged. The behavior where your graph ID can be inferred from the structure of your API key will be removed in Apollo Server 3.
- `apollo-server-core`: Fix a race condition where schema reporting could lead to a delay at process shutdown. [PR #5222](https://github.com/apollographql/apollo-server/pull/5222)
- `apollo-server-core`: Allow the Fetch API implementation to be overridden for the schema reporting and usage reporting plugins via a new `fetcher` option. [PR #5179](https://github.com/apollographql/apollo-server/pull/5179)
- `apollo-server-core`: The `server.executeOperation` method (designed for testing) can now take its `query` as a `DocumentNode` (eg, a `gql`-tagged string) in addition to as a string. (This matches the behavior of the `apollo-server-testing` `createTestClient` function which is now deprecated.) We now recommend this method instead of `apollo-server-testing` in our docs. [Issue #4952](https://github.com/apollographql/apollo-server/issues/4952)
Expand Down
9 changes: 0 additions & 9 deletions packages/apollo-server-core/src/determineApolloConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,13 @@ export function determineApolloConfig(
apolloConfig.graphVariant = apolloConfig.graphRef.substring(at + 1);
}
} else {
let usedKeyParser = false;
// Graph ref not specified. Let's try harder to get ID/variant, then join them.
if (!apolloConfig.graphId && apolloConfig.key) {
// If the given key is a graph token (starts with 'service:'), then use the
// service name written in the key. (We will remove this parser in AS3.)
const parts = apolloConfig.key.split(':', 2);
if (parts[0] === 'service') {
apolloConfig.graphId = parts[1];
usedKeyParser = true;
} else {
throw Error(
'You have specified an API key in `apollo.key` or `APOLLO_KEY`, ' +
Expand All @@ -152,13 +150,6 @@ export function determineApolloConfig(

if (apolloConfig.graphId) {
apolloConfig.graphRef = `${apolloConfig.graphId}@${apolloConfig.graphVariant}`;
if (usedKeyParser) {
logger.warn(
'Deprecation warning: Setting your graph ref based on parsing your API key. ' +
'API key parsing will be removed in Apollo Server 3. To be compatible with ' +
`Apollo Server 3, set \`APOLLO_GRAPH_REF\` to '${apolloConfig.graphRef}'.`,
);
}
}
}

Expand Down

0 comments on commit 6396938

Please sign in to comment.