Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a test in the lsp server for graphql@15, restore peer ranges #3786

Closed
wants to merge 4 commits into from
Closed
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
20 changes: 11 additions & 9 deletions .github/workflows/pr-graphql-compat-check.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Build & Test PR w/ GraphQL Regressions
name: Build & Test PR w/ GraphQL Peer Compatibility
on:
push:
# only on merge to main.
# it's rare that this workflow would
# show us an error, but when it does it's important!
branches:
- main
# branches:
# - main
# don't run this regression suite if we don't need to
paths-ignore:
- '**.md'
Expand All @@ -24,10 +24,12 @@ jobs:
strategy:
matrix:
release:
# test against the latest 16.x version, which might be newer than what we have
- '^16'
# test against the oldest version we support
- '^16.0.0'
# 15 stable tests work now!
- '15'
# test against the latest 16.x stable version, which might be newer than what we have
- '16'
# test against the oldest version we support (this might fail)
- '^15.8.0'
# test against the latest alpha
- '^17.0.0-alpha'
steps:
Expand All @@ -43,13 +45,13 @@ jobs:
path: node_modules
key: node_modules-${{hashFiles('yarn.lock')}}
restore-keys: node_modules-
- name: Force GraphQL ${{ matrix.release }} solution
- name: Resolve GraphQL ${{ matrix.release }} to test
run: yarn repo:resolve graphql@${{ matrix.release }}

- run: yarn install --frozen-lockfile --immutable

- name: Unit Tests
run: yarn test:ci
run: yarn test

- name: Cypress
run: yarn e2e
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,12 @@ 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,
FragmentDefinitionNode,
parse,
} from 'graphql';

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

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

describe('GraphQLLanguageService', () => {
const mockCache = {
async getSchema() {
Expand All @@ -40,19 +47,12 @@ describe('GraphQLLanguageService', () => {
},
getFragmentDefinitions() {
const definitions = new Map();
console.log(parse(`fragment TestFragment { id }`));
const fragmentDef = parse(`fragment TestFragment { id }`)[0];
definitions.set('TestFragment', {
filePath: 'fake file path',
content: 'fake file content',
definition: {
kind: 'FragmentDefinition',
name: {
value: 'TestFragment',
},
loc: {
start: 293,
end: 335,
},
},
definition: fragmentDef,
});
return definitions;
},
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
Loading