graphql-language-service-interface
Advanced tools
Comparing version 2.10.0 to 2.10.1-canary-07a2840d.0
@@ -16,5 +16,3 @@ "use strict"; | ||
if (op) { | ||
graphql_2.visit(graphql_2.parse(op, { | ||
allowLegacyFragmentVariables: true, | ||
}), { | ||
graphql_2.visit(graphql_2.parse(op), { | ||
FragmentDefinition(def) { | ||
@@ -21,0 +19,0 @@ externalFragments.push(def); |
@@ -13,5 +13,3 @@ import { CompletionItemKind, InsertTextFormat, } from 'vscode-languageserver-types'; | ||
if (op) { | ||
visit(parse(op, { | ||
allowLegacyFragmentVariables: true, | ||
}), { | ||
visit(parse(op), { | ||
FragmentDefinition(def) { | ||
@@ -18,0 +16,0 @@ externalFragments.push(def); |
{ | ||
"name": "graphql-language-service-interface", | ||
"version": "2.10.0", | ||
"version": "2.10.1-canary-07a2840d.0", | ||
"description": "Interface to the GraphQL Language Service", | ||
@@ -34,3 +34,3 @@ "contributors": [ | ||
"graphql-language-service-types": "^1.8.6", | ||
"graphql-language-service-utils": "^2.7.0", | ||
"graphql-language-service-utils": "^2.7.1-canary-07a2840d.0", | ||
"vscode-languageserver-types": "^3.15.1" | ||
@@ -37,0 +37,0 @@ }, |
@@ -12,3 +12,3 @@ /** | ||
import fs from 'fs'; | ||
import fs, { readSync } from 'fs'; | ||
import { | ||
@@ -19,2 +19,3 @@ buildSchema, | ||
parse, | ||
version as graphQLVersion, | ||
} from 'graphql'; | ||
@@ -81,2 +82,3 @@ import { Position } from 'graphql-language-service-utils'; | ||
beforeEach(async () => { | ||
// graphQLVersion = pkg.version; | ||
const schemaIDL = fs.readFileSync( | ||
@@ -438,25 +440,24 @@ path.join(__dirname, '__schema__/StarWarsSchema.graphql'), | ||
const expectedDirectiveSuggestions = [ | ||
{ label: 'include' }, | ||
{ label: 'skip' }, | ||
]; | ||
// TODO: remove this once defer and stream are merged to `graphql` | ||
if (graphQLVersion.includes('defer')) { | ||
expectedDirectiveSuggestions.push({ label: 'stream' }); | ||
} | ||
expectedDirectiveSuggestions.push({ label: 'test' }); | ||
it('provides correct directive suggestions', () => { | ||
expect(testSuggestions('{ test @ }', new Position(0, 8))).toEqual([ | ||
{ label: 'include' }, | ||
{ label: 'skip' }, | ||
{ label: 'stream' }, | ||
{ label: 'test' }, | ||
]); | ||
expect(testSuggestions('{ test @ }', new Position(0, 8))).toEqual( | ||
expectedDirectiveSuggestions, | ||
); | ||
expect(testSuggestions('{ test @', new Position(0, 8))).toEqual([ | ||
{ label: 'include' }, | ||
{ label: 'skip' }, | ||
{ label: 'stream' }, | ||
{ label: 'test' }, | ||
]); | ||
expect(testSuggestions('{ test @', new Position(0, 8))).toEqual( | ||
expectedDirectiveSuggestions, | ||
); | ||
expect( | ||
testSuggestions('{ aliasTest: test @ }', new Position(0, 19)), | ||
).toEqual([ | ||
{ label: 'include' }, | ||
{ label: 'skip' }, | ||
{ label: 'stream' }, | ||
{ label: 'test' }, | ||
]); | ||
).toEqual(expectedDirectiveSuggestions); | ||
@@ -463,0 +464,0 @@ expect(testSuggestions('query @', new Position(0, 7))).toEqual([]); |
@@ -87,12 +87,7 @@ /** | ||
if (op) { | ||
visit( | ||
parse(op, { | ||
allowLegacyFragmentVariables: true, | ||
}), | ||
{ | ||
FragmentDefinition(def) { | ||
externalFragments.push(def); | ||
}, | ||
visit(parse(op), { | ||
FragmentDefinition(def) { | ||
externalFragments.push(def); | ||
}, | ||
); | ||
}); | ||
} | ||
@@ -99,0 +94,0 @@ return externalFragments; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
391475
6828
2