Skip to content

Commit a117931

Browse files
committedSep 16, 2024··
fix test for 15
1 parent 71f2b5a commit a117931

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed
 

‎package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
"resolutions": {
145145
"@babel/traverse": "^7.23.2",
146146
"vscode-languageserver-types": "3.17.3",
147-
"markdown-it": "14.1.0"
147+
"markdown-it": "14.1.0",
148+
"graphql": "15"
148149
}
149150
}

‎packages/graphql-language-service-server/src/__tests__/GraphQLLanguageService.test.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { GraphQLLanguageService } from '../GraphQLLanguageService';
1414
import { SymbolKind } from 'vscode-languageserver-protocol';
1515
import { Position } from 'graphql-language-service';
1616
import { NoopLogger } from '../Logger';
17-
import { GraphQLEnumType } from 'graphql';
17+
import { GraphQLEnumType, version } from 'graphql';
1818

1919
const MOCK_CONFIG = {
2020
filepath: join(__dirname, '.graphqlrc.yml'),
@@ -24,6 +24,8 @@ const MOCK_CONFIG = {
2424
},
2525
};
2626

27+
const majorVersion = parseInt(version.split('.')[0]);
28+
2729
describe('GraphQLLanguageService', () => {
2830
const mockCache = {
2931
async getSchema() {
@@ -45,9 +47,12 @@ describe('GraphQLLanguageService', () => {
4547
content: 'fake file content',
4648
definition: {
4749
kind: 'FragmentDefinition',
48-
name: {
49-
value: 'TestFragment',
50-
},
50+
name:
51+
majorVersion < 16
52+
? 'TestFragment'
53+
: {
54+
value: 'TestFragment',
55+
},
5156
loc: {
5257
start: 293,
5358
end: 335,

‎yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10538,10 +10538,10 @@ graphql-ws@5.14.0, graphql-ws@^5.5.5:
1053810538
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.14.0.tgz#766f249f3974fc2c48fae0d1fb20c2c4c79cd591"
1053910539
integrity sha512-itrUTQZP/TgswR4GSSYuwWUzrE/w5GhbwM2GX3ic2U7aw33jgEsayfIlvaj7/GcIvZgNMzsPTrE5hqPuFUiE5g==
1054010540

10541-
"graphql@^16.8.1 || ^17.0.0-alpha.2", graphql@^16.9.0:
10542-
version "16.9.0"
10543-
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.9.0.tgz#1c310e63f16a49ce1fbb230bd0a000e99f6f115f"
10544-
integrity sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==
10541+
graphql@15, "graphql@^16.8.1 || ^17.0.0-alpha.2", graphql@^16.9.0:
10542+
version "15.9.0"
10543+
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.9.0.tgz#4e8ca830cfd30b03d44d3edd9cac2b0690304b53"
10544+
integrity sha512-GCOQdvm7XxV1S4U4CGrsdlEN37245eC8P9zaYCMr6K1BG0IPGy5lUwmJsEOGyl1GD6HXjOtl2keCP9asRBwNvA==
1054510545

1054610546
gzip-size@^5.0.0:
1054710547
version "5.1.1"

0 commit comments

Comments
 (0)
Please sign in to comment.