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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Upcoming

- `apollo`
- <First `apollo` related entry goes here>
- Don't send a user-specified frontend URL to Apollo's servers; fetch one when needed. Drop `--frontend` flag. [#1990](https://github.com/apollographql/apollo-tooling/pull/1990)
- `apollo-codegen-flow`
- <First `apollo-codegen-flow` related entry goes here>
- `apollo-codegen-scala`
Expand All @@ -19,7 +19,7 @@
- `apollo-graphql`
- <First `apollo-graphql` related entry goes here>
- `apollo-language-server`
- <First `apollo-language-server` related entry goes here>
- Don't send a user-specified frontend URL to Apollo's servers; fetch one when needed. [#1990](https://github.com/apollographql/apollo-tooling/pull/1990)
- `apollo-tools`
- <First `apollo-tools` related entry goes here>
- `vscode-apollo`
Expand Down
1 change: 0 additions & 1 deletion apollo.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = {
excludes: ["**/*.test.ts", "**/__tests__/*"]
},
engine: {
frontend: "https://engine-staging.apollographql.com",
endpoint: "https://engine-staging-graphql.apollographql.com/api/graphql"
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ describe("ApolloConfig", () => {
const config = new ApolloConfig({});
const overrides = {
engine: {
endpoint: "https://test.apollographql.com/api/graphql",
frontend: "https://test.apollographql.com"
endpoint: "https://test.apollographql.com/api/graphql"
}
};
config.setDefaults(overrides);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ describe("loadConfig", () => {
},
"engine": Object {
"endpoint": "https://engine-graphql.apollographql.com/api/graphql",
"frontend": "https://engine.apollographql.com",
},
}
`);
Expand All @@ -136,7 +135,6 @@ describe("loadConfig", () => {
Object {
"engine": Object {
"endpoint": "https://engine-graphql.apollographql.com/api/graphql",
"frontend": "https://engine.apollographql.com",
},
"service": Object {
"endpoint": Object {
Expand Down
4 changes: 1 addition & 3 deletions packages/apollo-language-server/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ export interface LocalServiceConfig {

export interface EngineConfig {
endpoint?: EndpointURI;
frontend?: EndpointURI;
readonly apiKey?: string;
}

export const DefaultEngineConfig = {
endpoint: "https://engine-graphql.apollographql.com/api/graphql",
frontend: "https://engine.apollographql.com"
endpoint: "https://engine-graphql.apollographql.com/api/graphql"
};

export const DefaultConfigBase = {
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-language-server/src/engine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class ApolloEngineClient extends GraphQLDataSource {
if (!(data && data.service)) {
throw new Error("Error in request from Apollo Graph Manager");
}
return data.service;
return data;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const CHECK_PARTIAL_SCHEMA = gql`
$partialSchema: PartialSchemaInput!
$gitContext: GitContextInput
$historicParameters: HistoricQueryParameters
$frontend: String
) {
service(id: $id) {
checkPartialSchema(
Expand All @@ -17,7 +16,6 @@ export const CHECK_PARTIAL_SCHEMA = gql`
partialSchema: $partialSchema
gitContext: $gitContext
historicParameters: $historicParameters
frontend: $frontend
) {
compositionValidationResult {
compositionValidationDetails {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const CHECK_SCHEMA = gql`
$tag: String
$gitContext: GitContextInput
$historicParameters: HistoricQueryParameters
$frontend: String
) {
service(id: $id) {
checkSchema(
Expand All @@ -17,7 +16,6 @@ export const CHECK_SCHEMA = gql`
baseSchemaTag: $tag
gitContext: $gitContext
historicParameters: $historicParameters
frontend: $frontend
) {
targetUrl
diffToPrevious {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import gql from "graphql-tag";

export const LIST_SERVICES = gql`
query ListServices($id: ID!, $graphVariant: String!) {
frontendUrlRoot
service(id: $id) {
implementingServices(graphVariant: $graphVariant) {
__typename
Expand Down
3 changes: 1 addition & 2 deletions packages/apollo-language-server/src/graphqlTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ export interface CheckPartialSchemaVariables {
partialSchema: PartialSchemaInput;
gitContext?: GitContextInput | null;
historicParameters?: HistoricQueryParameters | null;
frontend?: string | null;
}

/* tslint:disable */
Expand Down Expand Up @@ -296,7 +295,6 @@ export interface CheckSchemaVariables {
tag?: string | null;
gitContext?: GitContextInput | null;
historicParameters?: HistoricQueryParameters | null;
frontend?: string | null;
}

/* tslint:disable */
Expand Down Expand Up @@ -355,6 +353,7 @@ export interface ListServices_service {
}

export interface ListServices {
frontendUrlRoot: string;
/**
* Service by ID
*/
Expand Down
8 changes: 1 addition & 7 deletions packages/apollo/src/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export interface Flags {
localSchemaFile?: string;
key?: string;
engine?: string;
frontend?: string;
tag?: string;
variant?: string;
graph?: string;
Expand Down Expand Up @@ -89,10 +88,6 @@ export abstract class ProjectCommand extends Command {
engine: flags.string({
description: "URL for a custom Apollo Graph Manager deployment",
hidden: true
}),
frontend: flags.string({
description: "URL for a custom Apollo Graph Manager frontend",
hidden: true
})
};

Expand Down Expand Up @@ -161,8 +156,7 @@ export abstract class ProjectCommand extends Command {
config.setDefaults({
engine: {
apiKey: flags.key,
endpoint: flags.engine,
frontend: flags.frontend
endpoint: flags.engine
}
});

Expand Down
2 changes: 2 additions & 0 deletions packages/apollo/src/commands/service/__tests__/list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function mockServiceListFederated() {
)
.reply(200, {
data: {
frontendUrlRoot: "https://engine-staging.apollographql.com",
service: {
implementingServices: {
services: [
Expand Down Expand Up @@ -158,6 +159,7 @@ function mockServiceListNonFederated() {
)
.reply(200, {
data: {
frontendUrlRoot: "https://engine-staging.apollographql.com",
service: {
implementingServices: {
services: [],
Expand Down
2 changes: 0 additions & 2 deletions packages/apollo/src/commands/service/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ export default class ServiceCheck extends ProjectCommand {
partialSchema: {
sdl
},
frontend: flags.frontend || config.engine.frontend,
...(historicParameters && { historicParameters }),
gitContext: await gitInfo(this.log)
});
Expand Down Expand Up @@ -468,7 +467,6 @@ export default class ServiceCheck extends ProjectCommand {
id: graphID!,
tag: config.variant,
gitContext: await gitInfo(this.log),
frontend: flags.frontend || config.engine.frontend,
...(historicParameters && { historicParameters }),
...schemaCheckSchemaVariables
};
Expand Down
15 changes: 9 additions & 6 deletions packages/apollo/src/commands/service/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { graphUndefinedError } from "../../utils/sharedMessages";
interface TasksOutput {
config: ApolloConfig;
implementingServices: ListServices_service_implementingServices | null;
frontendUrlRoot: string;
}

const formatImplementingService = (
Expand All @@ -32,11 +33,11 @@ const formatImplementingService = (
function formatHumanReadable({
implementingServices,
graphName,
frontendUrl
frontendUrlRoot
}: {
implementingServices: ListServices_service_implementingServices | null;
graphName: string | undefined;
frontendUrl: string | undefined;
frontendUrlRoot: string;
}): string {
let result = "";
if (
Expand Down Expand Up @@ -76,7 +77,7 @@ function formatHumanReadable({
);

const serviceListUrlEnding = `/graph/${graphName}/service-list`;
const targetUrl = `${frontendUrl}${serviceListUrlEnding}`;
const targetUrl = `${frontendUrlRoot}${serviceListUrlEnding}`;
result += `\nView full details at: ${chalk.cyan(targetUrl)}\n`;
}
return result;
Expand Down Expand Up @@ -134,13 +135,16 @@ export default class ServiceList extends ProjectCommand {
)}`,
task: async (ctx: TasksOutput, task) => {
const {
implementingServices
frontendUrlRoot,
service
} = await project.engine.listServices({
id: graphID!,
graphVariant: graphVariant!
});
const { implementingServices } = service!;
const newContext: typeof ctx = {
implementingServices,
frontendUrlRoot,
config
};

Expand All @@ -162,8 +166,7 @@ export default class ServiceList extends ProjectCommand {
formatHumanReadable({
implementingServices: taskOutput.implementingServices,
graphName: taskOutput.config.graph,
frontendUrl:
taskOutput.config.engine.frontend || DefaultEngineConfig.frontend
frontendUrlRoot: taskOutput.frontendUrlRoot
})
);
}
Expand Down