File tree Expand file tree Collapse file tree
apollo-language-server/src/engine
apollo/src/commands/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 "node_modules" : false ,
1313 "lib" : true
1414 },
15- "typescript.tsdk" : " node_modules/typescript/lib"
15+ "typescript.tsdk" : " node_modules/typescript/lib" ,
16+ "debug.node.autoAttach" : " on"
1617}
Original file line number Diff line number Diff line change 44
55- ` apollo `
66 - Fix configuration loading and schema tag support [ #925 ] ( https://github.com/apollographql/apollo-tooling/pull/925 )
7+ - Improve client: check output [ #934 ] ( https://github.com/apollographql/apollo-tooling/pull/934 )
8+ - ` apollo-language-server `
9+ - Replace checkOperations mutation with new validateOperations mutation [ #934 ] ( https://github.com/apollographql/apollo-tooling/pull/934 )
710
811## ` apollo@2.3.1 `
912
Original file line number Diff line number Diff line change @@ -10,9 +10,10 @@ import {
1010} from "./operations/uploadSchema" ;
1111
1212import {
13- CHECK_OPERATIONS ,
14- CheckOperationsVariables
15- } from "./operations/checkOperations" ;
13+ VALIDATE_OPERATIONS ,
14+ ValidateOperationsVariables ,
15+ ValidationResult
16+ } from "./operations/validateOperations" ;
1617
1718import {
1819 REGISTER_OPERATIONS ,
@@ -161,8 +162,8 @@ export class ApolloEngineClient extends GraphQLDataSource {
161162 } ) ;
162163 }
163164
164- public async checkOperations ( variables : CheckOperationsVariables ) {
165- return this . execute ( { query : CHECK_OPERATIONS , variables } ) . then (
165+ public async validateOperations ( variables : ValidateOperationsVariables ) {
166+ return this . execute ( { query : VALIDATE_OPERATIONS , variables } ) . then (
166167 ( { data, errors } ) => {
167168 if ( data && ! data . service ) {
168169 throw new Error (
@@ -176,7 +177,9 @@ export class ApolloEngineClient extends GraphQLDataSource {
176177 if ( ! data ) {
177178 throw new Error ( "Error in request from Engine" ) ;
178179 }
179- return data . service . checkOperations ;
180+
181+ return data . service . validateOperations
182+ . validationResults as ValidationResult [ ] ;
180183 }
181184 ) ;
182185 }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import gql from "graphql-tag" ;
2+ import { GitContextInput } from "./checkSchema" ;
3+
4+ export interface OperationDocument {
5+ body : string ;
6+ name : string ;
7+ }
8+
9+ export enum ValidationErrorType {
10+ WARNING = "WARNING" ,
11+ FAILURE = "FAILURE" ,
12+ INVALID = "INVALID"
13+ }
14+
15+ export enum ValidationErrorCode {
16+ NON_PARSEABLE_DOCUMENT = "NON_PARSEABLE_DOCUMENT" ,
17+ INVALID_OPERATION = "INVALID_OPERATION" ,
18+ DEPRECATED_FIELD = "DEPRECATED_FIELD"
19+ }
20+
21+ export interface ValidationResult {
22+ type : ValidationErrorType ;
23+ code : ValidationErrorCode ;
24+ description : string ;
25+ operation : OperationDocument ;
26+ }
27+
28+ export interface ValidateOperationsVariables {
29+ id : string ;
30+ tag : string ;
31+ gitContext : GitContextInput ;
32+ operations : [ OperationDocument ] ;
33+ }
34+
35+ export const VALIDATE_OPERATIONS = gql `
36+ mutation ValidateOperations(
37+ $id: ID!
38+ $operations: [OperationDocumentInput!]!
39+ $tag: String
40+ $gitContext: GitContextInput
41+ ) {
42+ service(id: $id) {
43+ validateOperations(
44+ tag: $tag
45+ operations: $operations
46+ gitContext: $gitContext
47+ ) {
48+ validationResults {
49+ type
50+ code
51+ description
52+ operation {
53+ name
54+ }
55+ }
56+ }
57+ }
58+ }
59+ ` ;
You can’t perform that action at this time.
0 commit comments