Skip to content

Commit 6fdc24d

Browse files
committed
update checks operation to match new schema
1 parent 51e8aa5 commit 6fdc24d

3 files changed

Lines changed: 24 additions & 32 deletions

File tree

packages/apollo-language-server/src/engine/operations/checkPartialSchema.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const CHECK_PARTIAL_SCHEMA = gql`
1313
implementingServiceName: $implementingServiceName
1414
partialSchema: $partialSchema
1515
) {
16-
compositionConfig {
16+
compositionValidationDetails {
1717
schemaHash
1818
}
1919
errors {
@@ -22,7 +22,6 @@ export const CHECK_PARTIAL_SCHEMA = gql`
2222
warnings {
2323
message
2424
}
25-
didUpdateGateway: updatedGateway
2625
}
2726
}
2827
}

packages/apollo-language-server/src/graphqlTypes.ts

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// GraphQL mutation operation: CheckPartialSchema
77
// ====================================================
88

9-
export interface CheckPartialSchema_service_validatePartialSchemaOfImplementingServiceAgainstGraph_compositionConfig {
10-
__typename: "CompositionConfig";
9+
export interface CheckPartialSchema_service_validatePartialSchemaOfImplementingServiceAgainstGraph_compositionValidationDetails {
10+
__typename: "CompositionValidationDetails";
1111
/**
1212
* Hash of the composed schema
1313
*/
@@ -25,11 +25,13 @@ export interface CheckPartialSchema_service_validatePartialSchemaOfImplementingS
2525
}
2626

2727
export interface CheckPartialSchema_service_validatePartialSchemaOfImplementingServiceAgainstGraph {
28-
__typename: "CompositionResult";
28+
__typename: "CompositionValidationResult";
2929
/**
30-
* The produced composition config. Will be null if there are any errors
30+
* Akin to a composition config, represents the partial schemas and implementing services that were used
31+
* in running composition. Will be null if any errors are encountered. Also may contain a schema hash if
32+
* one could be computed, which can be used for schema validation.
3133
*/
32-
compositionConfig: CheckPartialSchema_service_validatePartialSchemaOfImplementingServiceAgainstGraph_compositionConfig | null;
34+
compositionValidationDetails: CheckPartialSchema_service_validatePartialSchemaOfImplementingServiceAgainstGraph_compositionValidationDetails | null;
3335
/**
3436
* List of errors during composition. Errors mean that Apollo was unable to compose the
3537
* graph's implementing services into a GraphQL schema. This partial schema should not be
@@ -44,21 +46,17 @@ export interface CheckPartialSchema_service_validatePartialSchemaOfImplementingS
4446
* in its composition result will result in updating the composition config.
4547
*/
4648
warnings: (CheckPartialSchema_service_validatePartialSchemaOfImplementingServiceAgainstGraph_warnings | null)[];
47-
/**
48-
* Whether the gateway link was updated.
49-
*/
50-
didUpdateGateway: boolean;
5149
}
5250

5351
export interface CheckPartialSchema_service {
5452
__typename: "ServiceMutation";
5553
/**
5654
* This mutation will not result in any changes to the implementing service
57-
*
55+
*
5856
* Run composition with the Implementing Service's partial schema replaced with the one provided
5957
* in the mutation's input. Store the composed schema, return the hash of the composed schema,
6058
* and any warnings and errors pertaining to composition.
61-
*
59+
*
6260
* This mutation will not run validation against operations.
6361
*/
6462
validatePartialSchemaOfImplementingServiceAgainstGraph: CheckPartialSchema_service_validatePartialSchemaOfImplementingServiceAgainstGraph;
@@ -167,11 +165,11 @@ export interface CheckSchema_service {
167165
/**
168166
* Validate, diff, and store a schema so the diff can be viewed by users in the UI.
169167
* This mutation will not mark the schema as "published".
170-
*
168+
*
171169
* One of "proposedSchema" or "proposedSchemaHash" must be provided.
172170
* If both are provided, the computed schema hash will be compared with the input hash,
173171
* an error will be returned if the hashes don't match.
174-
*
172+
*
175173
* If the "proposedSchemaHash" is specified, the already stored schema will be loaded.
176174
*/
177175
checkSchema: CheckSchema_service_checkSchema;
@@ -222,19 +220,15 @@ export interface RegisterOperationsVariables {
222220
// GraphQL mutation operation: RemoveServiceAndCompose
223221
// ====================================================
224222

225-
export interface RemoveServiceAndCompose_service_removeImplementingServiceAndTriggerComposition_compositionConfig_implementingServices {
226-
__typename: "FederatedImplementingService";
223+
export interface RemoveServiceAndCompose_service_removeImplementingServiceAndTriggerComposition_compositionConfig_implementingServiceLocations {
224+
__typename: "ImplementingServiceLocation";
227225
/**
228-
* Identifies which graph this implementing service belongs to.
229-
* Formerly known as "service_id"
226+
* The name of the implementing service
230227
*/
231-
graphID: string;
228+
name: string;
232229
/**
233-
* Specifies which variant of a graph this implementing service belongs to".
234-
* Formerly known as "tag"
230+
* The path in storage to access the implementing service config file
235231
*/
236-
graphVariant: string;
237-
name: string;
238232
path: string;
239233
}
240234

@@ -243,7 +237,7 @@ export interface RemoveServiceAndCompose_service_removeImplementingServiceAndTri
243237
/**
244238
* List of implementing services that comprise a composed graph
245239
*/
246-
implementingServices: RemoveServiceAndCompose_service_removeImplementingServiceAndTriggerComposition_compositionConfig_implementingServices[];
240+
implementingServiceLocations: RemoveServiceAndCompose_service_removeImplementingServiceAndTriggerComposition_compositionConfig_implementingServiceLocations[];
247241
}
248242

249243
export interface RemoveServiceAndCompose_service_removeImplementingServiceAndTriggerComposition_errors_location {
@@ -271,7 +265,7 @@ export interface RemoveServiceAndCompose_service_removeImplementingServiceAndTri
271265
}
272266

273267
export interface RemoveServiceAndCompose_service_removeImplementingServiceAndTriggerComposition {
274-
__typename: "CompositionResult";
268+
__typename: "CompositionAndRemoveResult";
275269
/**
276270
* The produced composition config. Will be null if there are any errors
277271
*/
@@ -488,10 +482,10 @@ export interface UploadAndComposePartialSchema_service {
488482
/**
489483
* Creates or updates an implementing service of a given "name" on the graph variant, then
490484
* updates the graph variant's composition configs/artifacts to reflect these changes.
491-
*
485+
*
492486
* An enriched SDL of the implementing service can be uploaded
493487
* via "implementingServiceConfiguration.partialSchema.partialSchemaSDL".
494-
*
488+
*
495489
* Alternatively, previously uploaded partial schema could be re-associated with the
496490
* implementing service via "implementingServiceConfiguration.partialSchema.partialSchemaHash".
497491
*/
@@ -1695,10 +1689,10 @@ export interface OperationDocumentInput {
16951689
/**
16961690
* Input for registering a partial schema to an implementing service.
16971691
* One of the fields must be specified (validated server-side).
1698-
*
1692+
*
16991693
* If a new partialSchemaSDL is passed in, this operation will store it before
17001694
* creating the association.
1701-
*
1695+
*
17021696
* If both the sdl and hash are specified, an error will be thrown if the provided
17031697
* hash doesn't match our hash of the sdl contents
17041698
*/

packages/apollo/src/commands/service/check.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ export default class ServiceCheck extends ProjectCommand {
266266
*/
267267
const {
268268
errors,
269-
warnings,
270-
compositionConfig
269+
warnings
271270
} = await project.engine.checkPartialSchema({
272271
id: config.name,
273272
graphVariant: config.tag,

0 commit comments

Comments
 (0)