Skip to content

Commit

Permalink
fix test for 15
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Sep 16, 2024
1 parent 71f2b5a commit a117931
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
"resolutions": {
"@babel/traverse": "^7.23.2",
"vscode-languageserver-types": "3.17.3",
"markdown-it": "14.1.0"
"markdown-it": "14.1.0",
"graphql": "15"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { GraphQLLanguageService } from '../GraphQLLanguageService';
import { SymbolKind } from 'vscode-languageserver-protocol';
import { Position } from 'graphql-language-service';
import { NoopLogger } from '../Logger';
import { GraphQLEnumType } from 'graphql';
import { GraphQLEnumType, version } from 'graphql';

const MOCK_CONFIG = {
filepath: join(__dirname, '.graphqlrc.yml'),
Expand All @@ -24,6 +24,8 @@ const MOCK_CONFIG = {
},
};

const majorVersion = parseInt(version.split('.')[0]);

describe('GraphQLLanguageService', () => {
const mockCache = {
async getSchema() {
Expand All @@ -45,9 +47,12 @@ describe('GraphQLLanguageService', () => {
content: 'fake file content',
definition: {
kind: 'FragmentDefinition',
name: {
value: 'TestFragment',
},
name:
majorVersion < 16
? 'TestFragment'
: {
value: 'TestFragment',
},
loc: {
start: 293,
end: 335,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10538,10 +10538,10 @@ [email protected], graphql-ws@^5.5.5:
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.14.0.tgz#766f249f3974fc2c48fae0d1fb20c2c4c79cd591"
integrity sha512-itrUTQZP/TgswR4GSSYuwWUzrE/w5GhbwM2GX3ic2U7aw33jgEsayfIlvaj7/GcIvZgNMzsPTrE5hqPuFUiE5g==

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

gzip-size@^5.0.0:
version "5.1.1"
Expand Down

0 comments on commit a117931

Please sign in to comment.