Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
- `vscode-apollo`
- <First `vscode-apollo` related entry goes here>

### apollo-env@0.10.0
## apollo@2.33.2

- Add a deprecation message to all `apollo service:*` commands, pointing people towards the [Apollo Rover CLI migration guide](https://go.apollo.dev/t/migration). <br/>
[@hwillson](https://github.com/hwillson) in [#2308](https://github.com/apollographql/apollo-tooling/pull/2308)

## apollo-env@0.10.0

- deps: Updated `node-fetch` to v2.6.1

Expand Down
87 changes: 76 additions & 11 deletions packages/apollo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $ npm install -g apollo
$ apollo COMMAND
running command...
$ apollo (-v|--version|version)
apollo/2.33.1 linux-x64 node-v14.16.1
apollo/2.33.1 darwin-x64 node-v14.15.3
$ apollo --help [COMMAND]
USAGE
$ apollo COMMAND
Expand Down Expand Up @@ -642,10 +642,16 @@ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/

## `apollo service:check`

Check a service against known operation workloads to find breaking changes
[DEPRECATED] Check a service against known operation workloads to find breaking changes

```
Check a service against known operation workloads to find breaking changes
[DEPRECATED] Check a service against known operation workloads to find breaking changes
-----------------------------------------------------------------
DEPRECATED: This command will be removed from the `apollo` CLI in
its next major version. Replacement functionality is available in
the new Apollo Rover CLI: https://go.apollo.dev/t/migration
-----------------------------------------------------------------


USAGE
$ apollo service:check
Expand Down Expand Up @@ -716,6 +722,13 @@ OPTIONS
for more granularity (see:
https://en.wikipedia.org/wiki/ISO_8601#Durations)

DESCRIPTION
-----------------------------------------------------------------
DEPRECATED: This command will be removed from the `apollo` CLI in
its next major version. Replacement functionality is available in
the new Apollo Rover CLI: https://go.apollo.dev/t/migration
-----------------------------------------------------------------

ALIASES
$ apollo schema:check
```
Expand All @@ -724,10 +737,16 @@ _See code: [src/commands/service/check.ts](https://github.com/apollographql/apol

## `apollo service:delete`

Delete a federated service from Apollo and recompose remaining services
[DEPRECATED] Delete a federated service from Apollo and recompose remaining services

```
Delete a federated service from Apollo and recompose remaining services
[DEPRECATED] Delete a federated service from Apollo and recompose remaining services
-----------------------------------------------------------------
DEPRECATED: This command will be removed from the `apollo` CLI in
its next major version. Replacement functionality is available in
the new Apollo Rover CLI: https://go.apollo.dev/t/migration
-----------------------------------------------------------------


USAGE
$ apollo service:delete
Expand Down Expand Up @@ -758,16 +777,29 @@ OPTIONS

--serviceName=serviceName (required) Provides the name of the
implementing service for a federated graph

DESCRIPTION
-----------------------------------------------------------------
DEPRECATED: This command will be removed from the `apollo` CLI in
its next major version. Replacement functionality is available in
the new Apollo Rover CLI: https://go.apollo.dev/t/migration
-----------------------------------------------------------------
```

_See code: [src/commands/service/delete.ts](https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/service/delete.ts)_

## `apollo service:download OUTPUT`

Download the schema from your GraphQL endpoint.
[DEPRECATED] Download the schema from your GraphQL endpoint.

```
Download the schema from your GraphQL endpoint.
[DEPRECATED] Download the schema from your GraphQL endpoint.
-----------------------------------------------------------------
DEPRECATED: This command will be removed from the `apollo` CLI in
its next major version. Replacement functionality is available in
the new Apollo Rover CLI: https://go.apollo.dev/t/migration
-----------------------------------------------------------------


USAGE
$ apollo service:download OUTPUT
Expand Down Expand Up @@ -797,6 +829,13 @@ OPTIONS

--key=key The API key to use for authentication to Apollo

DESCRIPTION
-----------------------------------------------------------------
DEPRECATED: This command will be removed from the `apollo` CLI in
its next major version. Replacement functionality is available in
the new Apollo Rover CLI: https://go.apollo.dev/t/migration
-----------------------------------------------------------------

ALIASES
$ apollo schema:download
```
Expand All @@ -805,10 +844,16 @@ _See code: [src/commands/service/download.ts](https://github.com/apollographql/a

## `apollo service:list`

List the services in a graph
[DEPRECATED] List the services in a graph

```
List the services in a graph
[DEPRECATED] List the services in a graph
-----------------------------------------------------------------
DEPRECATED: This command will be removed from the `apollo` CLI in
its next major version. Replacement functionality is available in
the new Apollo Rover CLI: https://go.apollo.dev/t/migration
-----------------------------------------------------------------


USAGE
$ apollo service:list
Expand All @@ -831,16 +876,29 @@ OPTIONS
if using the `--header` flag.

--key=key The API key to use for authentication to Apollo

DESCRIPTION
-----------------------------------------------------------------
DEPRECATED: This command will be removed from the `apollo` CLI in
its next major version. Replacement functionality is available in
the new Apollo Rover CLI: https://go.apollo.dev/t/migration
-----------------------------------------------------------------
```

_See code: [src/commands/service/list.ts](https://github.com/apollographql/apollo-tooling/blob/master/packages/apollo/src/commands/service/list.ts)_

## `apollo service:push`

Push a service definition to Apollo
[DEPRECATED] Push a service definition to Apollo

```
Push a service definition to Apollo
[DEPRECATED] Push a service definition to Apollo
-----------------------------------------------------------------
DEPRECATED: This command will be removed from the `apollo` CLI in
its next major version. Replacement functionality is available in
the new Apollo Rover CLI: https://go.apollo.dev/t/migration
-----------------------------------------------------------------


USAGE
$ apollo service:push
Expand Down Expand Up @@ -892,6 +950,13 @@ OPTIONS
Provides the url to the location of the implementing service for a
federated graph

DESCRIPTION
-----------------------------------------------------------------
DEPRECATED: This command will be removed from the `apollo` CLI in
its next major version. Replacement functionality is available in
the new Apollo Rover CLI: https://go.apollo.dev/t/migration
-----------------------------------------------------------------

ALIASES
$ apollo schema:publish
```
Expand Down
5 changes: 4 additions & 1 deletion packages/apollo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
"tsConfig": "<rootDir>/tsconfig.test.json",
"diagnostics": false
}
}
},
"setupFilesAfterEnv": [
"<rootDir>/test-utils/setup.js"
]
}
}
11 changes: 11 additions & 0 deletions packages/apollo/src/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,17 @@ export abstract class ProjectCommand extends Command {
async finally(err) {
// called after run and catch regardless of whether or not the command errored
}

static DEPRECATION_MSG =
"\n-----------------------------------------------------------------\n" +
"DEPRECATED: This command will be removed from the `apollo` CLI in \n" +
"its next major version. Replacement functionality is available in \n" +
"the new Apollo Rover CLI: https://go.apollo.dev/t/migration\n" +
"-----------------------------------------------------------------\n";

protected printDeprecationWarning() {
console.error(ProjectCommand.DEPRECATION_MSG);
}
}

export abstract class ClientCommand extends ProjectCommand {
Expand Down
5 changes: 4 additions & 1 deletion packages/apollo/src/commands/service/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ export function formatHumanReadable({
export default class ServiceCheck extends ProjectCommand {
static aliases = ["schema:check"];
static description =
"Check a service against known operation workloads to find breaking changes";
"[DEPRECATED] Check a service against known operation workloads to find breaking changes" +
ProjectCommand.DEPRECATION_MSG;
static flags = {
...ProjectCommand.flags,
tag: flags.string({
Expand Down Expand Up @@ -294,6 +295,8 @@ export default class ServiceCheck extends ProjectCommand {
};

async run() {
this.printDeprecationWarning();

// @ts-ignore we're going to populate `taskOutput` later
const taskOutput: TasksOutput = {};

Expand Down
5 changes: 4 additions & 1 deletion packages/apollo/src/commands/service/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { graphUndefinedError } from "../../utils/sharedMessages";

export default class ServiceDelete extends ProjectCommand {
static description =
"Delete a federated service from Apollo and recompose remaining services";
"[DEPRECATED] Delete a federated service from Apollo and recompose remaining services" +
ProjectCommand.DEPRECATION_MSG;
static flags = {
...ProjectCommand.flags,
tag: flags.string({
Expand Down Expand Up @@ -46,6 +47,8 @@ export default class ServiceDelete extends ProjectCommand {
};

async run() {
this.printDeprecationWarning();

let result;
const { flags } = this.parse(ServiceDelete);

Expand Down
6 changes: 5 additions & 1 deletion packages/apollo/src/commands/service/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { dirname as getDirName } from "path";

export default class ServiceDownload extends ProjectCommand {
static aliases = ["schema:download"];
static description = "Download the schema from your GraphQL endpoint.";
static description =
"[DEPRECATED] Download the schema from your GraphQL endpoint." +
ProjectCommand.DEPRECATION_MSG;

static flags = {
...ProjectCommand.flags,
Expand Down Expand Up @@ -46,6 +48,8 @@ export default class ServiceDownload extends ProjectCommand {
];

async run() {
this.printDeprecationWarning();

await this.runTasks(({ args, project, flags, config }) => [
{
title: `Saving schema to ${args.output}`,
Expand Down
6 changes: 5 additions & 1 deletion packages/apollo/src/commands/service/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ function formatHumanReadable({
}

export default class ServiceList extends ProjectCommand {
static description = "List the services in a graph";
static description =
"[DEPRECATED] List the services in a graph" +
ProjectCommand.DEPRECATION_MSG;
static flags = {
...ProjectCommand.flags,
tag: flags.string({
Expand All @@ -107,6 +109,8 @@ export default class ServiceList extends ProjectCommand {
};

async run() {
this.printDeprecationWarning();

// @ts-ignore we're going to populate `taskOutput` later
const taskOutput: TasksOutput = {};

Expand Down
6 changes: 5 additions & 1 deletion packages/apollo/src/commands/service/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import { graphUndefinedError } from "../../utils/sharedMessages";

export default class ServicePush extends ProjectCommand {
static aliases = ["schema:publish"];
static description = "Push a service definition to Apollo";
static description =
"[DEPRECATED] Push a service definition to Apollo" +
ProjectCommand.DEPRECATION_MSG;
static flags = {
...ProjectCommand.flags,
tag: flags.string({
Expand Down Expand Up @@ -65,6 +67,8 @@ export default class ServicePush extends ProjectCommand {
};

async run() {
this.printDeprecationWarning();

let result;
let isFederated;
let gitContext;
Expand Down
7 changes: 7 additions & 0 deletions packages/apollo/test-utils/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
global.console = {
log: jest.fn(),
error: jest.fn(),
warn: console.warn,
info: console.info,
debug: console.debug,
};
Comment thread
hwillson marked this conversation as resolved.