From e45838f5ba579e05b20f1a147ce431478ffad9aa Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Sun, 16 Feb 2020 13:54:35 -0500 Subject: [PATCH] feat: use new GraphQL Config (#1342) * fix: use new GraphQL Config Co-authored-by: Arda TANRIKULU <20847995+ardatan@users.noreply.github.com> --- .../package.json | 2 +- .../src/GraphQLLanguageService.ts | 16 +- .../__tests__/GraphQLLanguageService-test.ts | 26 +- .../src/getOutline.ts | 6 +- .../package.json | 2 +- .../package.json | 2 +- .../src/GraphQLCache.ts | 115 ++---- .../src/MessageProcessor.ts | 67 ++-- .../src/__tests__/.graphqlconfig | 59 --- .../src/__tests__/.graphqlrc.yml | 30 ++ .../src/__tests__/GraphQLCache-test.ts | 39 +- .../src/__tests__/MessageProcessor-test.ts | 4 +- .../package.json | 2 +- .../package.json | 2 +- packages/graphql-language-service/README.md | 14 +- .../graphql-language-service/package.json | 2 +- yarn.lock | 337 ++++++++++++++++-- 17 files changed, 452 insertions(+), 273 deletions(-) delete mode 100644 packages/graphql-language-service-server/src/__tests__/.graphqlconfig create mode 100644 packages/graphql-language-service-server/src/__tests__/.graphqlrc.yml diff --git a/packages/graphql-language-service-interface/package.json b/packages/graphql-language-service-interface/package.json index c811357c185..62f6525aafd 100644 --- a/packages/graphql-language-service-interface/package.json +++ b/packages/graphql-language-service-interface/package.json @@ -27,7 +27,7 @@ "graphql": "^0.12.0 || ^0.13.0 || ^14.0.0" }, "dependencies": { - "graphql-config": "2.2.1", + "graphql-config": "3.0.0-alpha.17", "graphql-language-service-parser": "^1.5.3-alpha.1", "graphql-language-service-types": "^1.6.0-alpha.1", "graphql-language-service-utils": "^2.4.0-alpha.1" diff --git a/packages/graphql-language-service-interface/src/GraphQLLanguageService.ts b/packages/graphql-language-service-interface/src/GraphQLLanguageService.ts index 8e2727a8b42..a2904c9f815 100644 --- a/packages/graphql-language-service-interface/src/GraphQLLanguageService.ts +++ b/packages/graphql-language-service-interface/src/GraphQLLanguageService.ts @@ -21,15 +21,13 @@ import { DefinitionQueryResult, Diagnostic, GraphQLCache, - GraphQLConfig, - GraphQLProjectConfig, Uri, Position, Outline, OutlineTree, } from 'graphql-language-service-types'; -// import { Position } from 'graphql-language-service-utils'; +import { GraphQLConfig, GraphQLProjectConfig } from 'graphql-config'; import { Hover, SymbolInformation, @@ -111,7 +109,7 @@ export class GraphQLLanguageService { } getConfigForURI(uri: Uri) { - const config = this._graphQLConfig.getConfigForFile(uri); + const config = this._graphQLConfig.getProjectForFile(uri); if (config) { return config; } @@ -127,7 +125,7 @@ export class GraphQLLanguageService { // schema/fragment definitions, even the project configuration. let queryHasExtensions = false; const projectConfig = this.getConfigForURI(uri); - const { schemaPath, projectName, extensions } = projectConfig; + const { schema: schemaPath, name: projectName, extensions } = projectConfig; try { const queryAST = parse(query); @@ -228,7 +226,7 @@ export class GraphQLLanguageService { ): Promise> { const projectConfig = this.getConfigForURI(filePath); const schema = await this._graphQLCache - .getSchema(projectConfig.projectName) + .getSchema(projectConfig.name) .catch(() => null); if (schema) { @@ -244,7 +242,7 @@ export class GraphQLLanguageService { ): Promise { const projectConfig = this.getConfigForURI(filePath); const schema = await this._graphQLCache - .getSchema(projectConfig.projectName) + .getSchema(projectConfig.name) .catch(() => null); if (schema) { @@ -435,7 +433,7 @@ export class GraphQLLanguageService { return result; } - async getOutline(query: string): Promise { - return getOutline(query); + async getOutline(documentText: string): Promise { + return getOutline(documentText); } } diff --git a/packages/graphql-language-service-interface/src/__tests__/GraphQLLanguageService-test.ts b/packages/graphql-language-service-interface/src/__tests__/GraphQLLanguageService-test.ts index d8ead5ede17..b404488277a 100644 --- a/packages/graphql-language-service-interface/src/__tests__/GraphQLLanguageService-test.ts +++ b/packages/graphql-language-service-interface/src/__tests__/GraphQLLanguageService-test.ts @@ -8,8 +8,6 @@ */ import { join } from 'path'; -import * as fs from 'fs'; -import { buildSchema } from 'graphql'; import { GraphQLConfig } from 'graphql-config'; import { GraphQLLanguageService } from '../GraphQLLanguageService'; @@ -17,24 +15,22 @@ import { SymbolKind } from 'vscode-languageserver-protocol'; import { Position } from 'graphql-language-service-utils'; const MOCK_CONFIG = { - schemaPath: './__schema__/StarWarsSchema.graphql', - includes: ['./queries/**', '**/*.graphql'], + filepath: join(__dirname, '.graphqlrc.yml'), + config: { + schema: './__schema__/StarWarsSchema.graphql', + documents: ['./queries/**', '**/*.graphql'], + }, }; describe('GraphQLLanguageService', () => { - const mockCache: any = { - getSchema() { - const schemaSDL = fs.readFileSync( - join(__dirname, '__schema__/StarWarsSchema.graphql'), - 'utf8', - ); - - const schemaJS = buildSchema(schemaSDL); - return new Promise((resolve, _reject) => resolve(schemaJS)); + const mockCache = { + async getSchema() { + const config = this.getGraphQLConfig(); + return config.getDefault()!.getSchema(); }, getGraphQLConfig() { - return new GraphQLConfig(MOCK_CONFIG, join(__dirname, '.graphqlconfig')); + return new GraphQLConfig(MOCK_CONFIG, []); }, getObjectTypeDefinitions() { @@ -78,7 +74,7 @@ describe('GraphQLLanguageService', () => { let languageService: GraphQLLanguageService; beforeEach(() => { - languageService = new GraphQLLanguageService(mockCache); + languageService = new GraphQLLanguageService(mockCache as any); }); it('runs diagnostic service as expected', async () => { diff --git a/packages/graphql-language-service-interface/src/getOutline.ts b/packages/graphql-language-service-interface/src/getOutline.ts index 62935d72f93..a3573f985df 100644 --- a/packages/graphql-language-service-interface/src/getOutline.ts +++ b/packages/graphql-language-service-interface/src/getOutline.ts @@ -76,15 +76,15 @@ type OutlineTreeConverterType = Partial< } >; -export function getOutline(queryText: string): Outline | null { +export function getOutline(documentText: string): Outline | null { let ast; try { - ast = parse(queryText); + ast = parse(documentText); } catch (error) { return null; } - const visitorFns = outlineTreeConverter(queryText); + const visitorFns = outlineTreeConverter(documentText); const outlineTrees = visit(ast, { leave(node) { if (visitorFns !== undefined && node.kind in visitorFns) { diff --git a/packages/graphql-language-service-parser/package.json b/packages/graphql-language-service-parser/package.json index 17a7a47159a..451a3b4b871 100644 --- a/packages/graphql-language-service-parser/package.json +++ b/packages/graphql-language-service-parser/package.json @@ -27,7 +27,7 @@ "graphql": "^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" }, "dependencies": { - "graphql-config": "2.2.1", + "graphql-config": "3.0.0-alpha.17", "graphql-language-service-types": "^1.6.0-alpha.1" } } diff --git a/packages/graphql-language-service-server/package.json b/packages/graphql-language-service-server/package.json index b68e4eedfd6..e65e7cce804 100644 --- a/packages/graphql-language-service-server/package.json +++ b/packages/graphql-language-service-server/package.json @@ -29,7 +29,7 @@ "dependencies": { "@babel/parser": "^7.4.5", "glob": "^7.1.2", - "graphql-config": "2.2.1", + "graphql-config": "3.0.0-alpha.17", "graphql-language-service-interface": "^2.4.0-alpha.1", "graphql-language-service-types": "^1.6.0-alpha.1", "graphql-language-service-utils": "^2.4.0-alpha.1", diff --git a/packages/graphql-language-service-server/src/GraphQLCache.ts b/packages/graphql-language-service-server/src/GraphQLCache.ts index bee489be42b..6d0b7015013 100644 --- a/packages/graphql-language-service-server/src/GraphQLCache.ts +++ b/packages/graphql-language-service-server/src/GraphQLCache.ts @@ -11,13 +11,11 @@ import { ASTNode, DocumentNode, DefinitionNode } from 'graphql/language'; import { CachedContent, GraphQLCache as GraphQLCacheInterface, - GraphQLConfig as GraphQLConfigInterface, GraphQLFileMetadata, GraphQLFileInfo, FragmentInfo, ObjectTypeInfo, Uri, - GraphQLProjectConfig, } from 'graphql-language-service-types'; import * as fs from 'fs'; @@ -25,9 +23,9 @@ import { GraphQLSchema, Kind, extendSchema, parse, visit } from 'graphql'; import nullthrows from 'nullthrows'; import { - getGraphQLConfig, + loadConfig, GraphQLConfig, - GraphQLEndpoint, + GraphQLProjectConfig, } from 'graphql-config'; import { getQueryAndRange } from './MessageProcessor'; import stringToHash from './stringToHash'; @@ -54,8 +52,10 @@ const { DIRECTIVE_DEFINITION, } = Kind; -export async function getGraphQLCache(configDir: Uri): Promise { - const graphQLConfig = await getGraphQLConfig(configDir); +export async function getGraphQLCache( + configDir: Uri, +): Promise { + const graphQLConfig = await loadConfig({ rootDir: configDir }); return new GraphQLCache(configDir, graphQLConfig); } @@ -78,7 +78,7 @@ export class GraphQLCache implements GraphQLCacheInterface { this._typeExtensionMap = new Map(); } - getGraphQLConfig = (): GraphQLConfigInterface => this._graphQLConfig; + getGraphQLConfig = (): GraphQLConfig => this._graphQLConfig; getFragmentDependencies = async ( query: string, @@ -159,17 +159,21 @@ export class GraphQLCache implements GraphQLCacheInterface { ): Promise> => { // This function may be called from other classes. // If then, check the cache first. - const rootDir = projectConfig.configDir; + const rootDir = projectConfig.dirpath; if (this._fragmentDefinitionsCache.has(rootDir)) { return this._fragmentDefinitionsCache.get(rootDir) || new Map(); } const filesFromInputDirs = await this._readFilesFromInputDirs( rootDir, - projectConfig.includes, + projectConfig.include instanceof Array + ? projectConfig.include + : projectConfig.include + ? [projectConfig.include] + : [], ); const list = filesFromInputDirs.filter(fileInfo => - projectConfig.includesFile(fileInfo.filePath), + projectConfig.match(fileInfo.filePath), ); const { @@ -271,16 +275,20 @@ export class GraphQLCache implements GraphQLCacheInterface { ): Promise> => { // This function may be called from other classes. // If then, check the cache first. - const rootDir = projectConfig.configDir; + const rootDir = projectConfig.dirpath; if (this._typeDefinitionsCache.has(rootDir)) { return this._typeDefinitionsCache.get(rootDir) || new Map(); } const filesFromInputDirs = await this._readFilesFromInputDirs( rootDir, - projectConfig.includes, + projectConfig.include instanceof Array + ? projectConfig.include + : projectConfig.include + ? [projectConfig.include] + : [], ); const list = filesFromInputDirs.filter(fileInfo => - projectConfig.includesFile(fileInfo.filePath), + projectConfig.match(fileInfo.filePath), ); const { objectTypeDefinitions, @@ -589,44 +597,20 @@ export class GraphQLCache implements GraphQLCacheInterface { appName?: string, queryHasExtensions?: boolean | null, ): Promise => { - const projectConfig = this._graphQLConfig.getProjectConfig(appName); + const projectConfig = this._graphQLConfig.getProject(appName); if (!projectConfig) { return null; } - const schemaPath = projectConfig.schemaPath; - const endpointInfo = this._getDefaultEndpoint(projectConfig); - const { endpointKey, schemaKey } = this._getSchemaCacheKeysForProject( - projectConfig, - ); + const schemaPath = projectConfig.schema as string; + const schemaKey = this._getSchemaCacheKeyForProject(projectConfig); let schemaCacheKey = null; let schema = null; - if (endpointInfo && endpointKey) { - const { endpoint } = endpointInfo; - schemaCacheKey = endpointKey; - - // Maybe use cache - if (this._schemaMap.has(schemaCacheKey)) { - schema = this._schemaMap.get(schemaCacheKey); - // @ts-ignore - return schema && queryHasExtensions - ? this._extendSchema(schema, schemaPath, schemaCacheKey) - : schema; - } - - // Read schema from network - try { - schema = await endpoint.resolveSchema(); - } catch (failure) { - // Never mind - } - } - if (!schema && schemaPath && schemaKey) { - schemaCacheKey = schemaKey; + schemaCacheKey = schemaKey as string; // Maybe use cache if (this._schemaMap.has(schemaCacheKey)) { @@ -639,7 +623,7 @@ export class GraphQLCache implements GraphQLCacheInterface { } // Read from disk - schema = projectConfig.getSchema(); + schema = await projectConfig.getSchema(); } const customDirectives = projectConfig.extensions.customDirectives; @@ -669,55 +653,18 @@ export class GraphQLCache implements GraphQLCacheInterface { }; _invalidateSchemaCacheForProject(projectConfig: GraphQLProjectConfig) { - const { endpointKey, schemaKey } = this._getSchemaCacheKeysForProject( + const schemaKey = this._getSchemaCacheKeyForProject( projectConfig, - ); - endpointKey && this._schemaMap.delete(endpointKey); + ) as string; schemaKey && this._schemaMap.delete(schemaKey); } - _getSchemaCacheKeysForProject(projectConfig: GraphQLProjectConfig) { - const endpointInfo = this._getDefaultEndpoint(projectConfig); - const projectName = this._getProjectName(projectConfig); - return { - endpointKey: endpointInfo - ? `${endpointInfo.endpointName}:${projectName}` - : null, - schemaKey: projectConfig.schemaPath - ? `${projectConfig.schemaPath}:${projectName}` - : null, - }; + _getSchemaCacheKeyForProject(projectConfig: GraphQLProjectConfig) { + return projectConfig.schema; } _getProjectName(projectConfig: GraphQLProjectConfig) { - return projectConfig || 'undefinedName'; - } - - _getDefaultEndpoint( - projectConfig: GraphQLProjectConfig, - ): { endpointName: string; endpoint: GraphQLEndpoint } | null { - // Jumping through hoops to get the default endpoint by name (needed for cache key) - const endpointsExtension = projectConfig.endpointsExtension; - if (!endpointsExtension) { - return null; - } - // not public but needed - // @ts-ignore - const defaultRawEndpoint = endpointsExtension.getRawEndpoint(); - const rawEndpointsMap = endpointsExtension.getRawEndpointsMap(); - - const endpointName = Object.keys(rawEndpointsMap).find( - name => rawEndpointsMap[name] === defaultRawEndpoint, - ); - - if (!endpointName) { - return null; - } - - return { - endpointName, - endpoint: endpointsExtension.getEndpoint(endpointName), - }; + return projectConfig || 'default'; } /** diff --git a/packages/graphql-language-service-server/src/MessageProcessor.ts b/packages/graphql-language-service-server/src/MessageProcessor.ts index 44afa3f4973..a7f94232a09 100644 --- a/packages/graphql-language-service-server/src/MessageProcessor.ts +++ b/packages/graphql-language-service-server/src/MessageProcessor.ts @@ -7,18 +7,15 @@ * */ -import { extname, dirname } from 'path'; +import { extname } from 'path'; import { readFileSync } from 'fs'; import { URL } from 'url'; -import { findGraphQLConfigFile } from 'graphql-config'; import { CachedContent, GraphQLCache, Uri, FileChangeTypeKind, - // Outline, - // OutlineTree, DefinitionQueryResult, } from 'graphql-language-service-types'; @@ -107,11 +104,7 @@ export class MessageProcessor { }, }; - const rootPath = dirname( - findGraphQLConfigFile( - configDir ? configDir.trim() : (params.rootPath as string), - ), - ); + const rootPath = configDir ? configDir.trim() : params.rootPath; if (!rootPath) { throw new Error( '`--configDir` option or `rootPath` argument is required.', @@ -180,13 +173,15 @@ export class MessageProcessor { }), ); + const project = this._graphQLCache + .getGraphQLConfig() + .getProjectForFile(uri); + this._logger.log( JSON.stringify({ type: 'usage', messageType: 'textDocument/didOpen', - projectName: this._graphQLCache - .getGraphQLConfig() - .getProjectNameForFile(uri), + projectName: project && project.name, fileName: uri, }), ); @@ -249,13 +244,15 @@ export class MessageProcessor { }), ); + const project = this._graphQLCache + .getGraphQLConfig() + .getProjectForFile(uri); + this._logger.log( JSON.stringify({ type: 'usage', messageType: 'textDocument/didChange', - projectName: this._graphQLCache - .getGraphQLConfig() - .getProjectNameForFile(uri), + projectName: project && project.name, fileName: uri, }), ); @@ -280,13 +277,15 @@ export class MessageProcessor { this._textDocumentCache.delete(uri); } + const project = this._graphQLCache + .getGraphQLConfig() + .getProjectForFile(uri); + this._logger.log( JSON.stringify({ type: 'usage', messageType: 'textDocument/didClose', - projectName: this._graphQLCache - .getGraphQLConfig() - .getProjectNameForFile(uri), + projectName: project && project.name, fileName: uri, }), ); @@ -359,13 +358,15 @@ export class MessageProcessor { textDocument.uri, ); + const project = this._graphQLCache + .getGraphQLConfig() + .getProjectForFile(textDocument.uri); + this._logger.log( JSON.stringify({ type: 'usage', messageType: 'textDocument/completion', - projectName: this._graphQLCache - .getGraphQLConfig() - .getProjectNameForFile(textDocument.uri), + projectName: project && project.name, fileName: textDocument.uri, }), ); @@ -456,13 +457,15 @@ export class MessageProcessor { ) ).reduce((left, right) => left.concat(right)); + const project = this._graphQLCache + .getGraphQLConfig() + .getProjectForFile(uri); + this._logger.log( JSON.stringify({ type: 'usage', messageType: 'workspace/didChangeWatchedFiles', - projectName: this._graphQLCache - .getGraphQLConfig() - .getProjectNameForFile(uri), + projectName: project && project.name, fileName: uri, }), ); @@ -470,12 +473,12 @@ export class MessageProcessor { return { uri, diagnostics }; } else if (change.type === FileChangeTypeKind.Deleted) { this._graphQLCache.updateFragmentDefinitionCache( - this._graphQLCache.getGraphQLConfig().configDir, + this._graphQLCache.getGraphQLConfig().dirpath, change.uri, false, ); this._graphQLCache.updateObjectTypeDefinitionCache( - this._graphQLCache.getGraphQLConfig().configDir, + this._graphQLCache.getGraphQLConfig().dirpath, change.uri, false, ); @@ -543,13 +546,15 @@ export class MessageProcessor { }) : []; + const project = this._graphQLCache + .getGraphQLConfig() + .getProjectForFile(textDocument.uri); + this._logger.log( JSON.stringify({ type: 'usage', messageType: 'textDocument/definition', - projectName: this._graphQLCache - .getGraphQLConfig() - .getProjectNameForFile(textDocument.uri), + projectName: project && project.name, fileName: textDocument.uri, }), ); @@ -610,7 +615,7 @@ export class MessageProcessor { uri: Uri, contents: CachedContent[], ): Promise { - const rootDir = this._graphQLCache.getGraphQLConfig().configDir; + const rootDir = this._graphQLCache.getGraphQLConfig().dirpath; await this._graphQLCache.updateFragmentDefinition( rootDir, @@ -623,7 +628,7 @@ export class MessageProcessor { uri: Uri, contents: CachedContent[], ): Promise { - const rootDir = this._graphQLCache.getGraphQLConfig().configDir; + const rootDir = this._graphQLCache.getGraphQLConfig().dirpath; await this._graphQLCache.updateObjectTypeDefinition( rootDir, diff --git a/packages/graphql-language-service-server/src/__tests__/.graphqlconfig b/packages/graphql-language-service-server/src/__tests__/.graphqlconfig deleted file mode 100644 index 6732672aac0..00000000000 --- a/packages/graphql-language-service-server/src/__tests__/.graphqlconfig +++ /dev/null @@ -1,59 +0,0 @@ -{ - "projects": { - "testWithSchema": { - "schemaPath": "__schema__/StarWarsSchema.graphql" - }, - "testWithEndpoint": { - "extensions": { - "endpoints": { - "prod": { - "url": "https://example.com/graphql" - } - } - } - }, - "testWithEndpointAndSchema": { - "schemaPath": "__schema__/StarWarsSchema.graphql", - "extensions": { - "endpoints": { - "prod": { - "url": "https://example.com/graphql" - } - } - } - }, - "testWithoutSchema": { - }, - "testWithCustomDirectives": { - "schemaPath": "__schema__/StarWarsSchema.graphql", - "extensions": { - "customDirectives": [ - "directive @customDirective on FIELD" - ] - } - }, - "testSingularIncludesGlob": { - "schemaPath": "__schema__/StarWarsSchema.graphql", - "includes": [ "__queries__/*.graphql" ] - }, - "testMultipleIncludes": { - "schemaPath": "__schema__/StarWarsSchema.graphql", - "includes": [ - "__queries__/*.graphql", - "__fragments__/*.graphql" - ] - }, - "testNoIncludes": { - "schemaPath": "__schema__/StarWarsSchema.graphql" - }, - "testBadIncludes": { - "schemaPath": "__schema__/StarWarsSchema.graphql", - "includes": ["nope.nopeql"] - } - }, - "extensions": { - "customDirectives": [ - "directive @customDirective on FRAGMENT_SPREAD" - ] - } -} diff --git a/packages/graphql-language-service-server/src/__tests__/.graphqlrc.yml b/packages/graphql-language-service-server/src/__tests__/.graphqlrc.yml new file mode 100644 index 00000000000..65f03980405 --- /dev/null +++ b/packages/graphql-language-service-server/src/__tests__/.graphqlrc.yml @@ -0,0 +1,30 @@ +projects: + testWithSchema: + schema: + - __schema__/StarWarsSchema.graphql + - "directive @customDirective on FRAGMENT_SPREAD" + testWithEndpoint: + schema: https://example.com/graphql + testWithEndpointAndSchema: + schema: + - __schema__/StarWarsSchema.graphql + - https://example.com/graphql + testWithoutSchema: + schema: "" + testWithCustomDirectives: + schema: + - __schema__/StarWarsSchema.graphql + - "directive @customDirective on FIELD" + testSingularIncludesGlob: + schema: __schema__/StarWarsSchema.graphql + include: __queries__/*.graphql + testMultipleIncludes: + schema: __schema__/StarWarsSchema.graphql + include: + - __queries__/*.graphql + - __fragments__/*.graphql + testNoIncludes: + schema: __schema__/StarWarsSchema.graphql + testBadIncludes: + schema: __schema__/StarWarsSchema.graphql + include: nope.nopeql diff --git a/packages/graphql-language-service-server/src/__tests__/GraphQLCache-test.ts b/packages/graphql-language-service-server/src/__tests__/GraphQLCache-test.ts index 6d00892401e..e2073d86e4c 100644 --- a/packages/graphql-language-service-server/src/__tests__/GraphQLCache-test.ts +++ b/packages/graphql-language-service-server/src/__tests__/GraphQLCache-test.ts @@ -7,10 +7,14 @@ * */ +jest.mock('cross-fetch', () => ({ + fetch: require('fetch-mock').fetchHandler, +})); import { GraphQLSchema } from 'graphql/type'; import { parse } from 'graphql/language'; -import { getGraphQLConfig } from 'graphql-config'; +import { loadConfig } from 'graphql-config'; import fetchMock from 'fetch-mock'; +import { introspectionFromSchema } from 'graphql'; import { GraphQLCache } from '../GraphQLCache'; import { getQueryAndRange } from '../MessageProcessor'; @@ -23,11 +27,12 @@ function wihtoutASTNode(definition: any) { describe('GraphQLCache', () => { const configDir = __dirname; - let graphQLRC = getGraphQLConfig(configDir); + let graphQLRC; let cache = new GraphQLCache(configDir, graphQLRC); beforeEach(async () => { - graphQLRC = getGraphQLConfig(configDir); + const configDir = __dirname; + graphQLRC = await loadConfig({ rootDir: configDir }); cache = new GraphQLCache(configDir, graphQLRC); }); @@ -42,9 +47,12 @@ describe('GraphQLCache', () => { }); it('generates the schema correctly from endpoint', async () => { - const introspectionResult = await graphQLRC - .getProjectConfig('testWithSchema') - .resolveIntrospection(); + const introspectionResult = { + data: introspectionFromSchema( + await graphQLRC.getProject('testWithSchema').getSchema(), + { descriptions: true }, + ), + }; fetchMock.mock({ matcher: '*', response: { @@ -60,17 +68,6 @@ describe('GraphQLCache', () => { expect(schema instanceof GraphQLSchema).toEqual(true); }); - it('falls through to schema on disk if endpoint fails', async () => { - fetchMock.mock({ - matcher: '*', - response: 500, - }); - - const schema = await cache.getSchema('testWithEndpointAndSchema'); - expect(fetchMock.called('*')).toEqual(true); - expect(schema instanceof GraphQLSchema).toEqual(true); - }); - it('does not generate a schema without a schema path or endpoint', async () => { const schema = await cache.getSchema('testWithoutSchema'); expect(schema instanceof GraphQLSchema).toEqual(false); @@ -166,25 +163,25 @@ describe('GraphQLCache', () => { describe('getFragmentDefinitions', () => { it('it caches fragments found through single glob in `includes`', async () => { - const config = graphQLRC.getProjectConfig('testSingularIncludesGlob'); + const config = graphQLRC.getProject('testSingularIncludesGlob'); const fragmentDefinitions = await cache.getFragmentDefinitions(config); expect(fragmentDefinitions.get('testFragment')).not.toBeUndefined(); }); it('it caches fragments found through multiple globs in `includes`', async () => { - const config = graphQLRC.getProjectConfig('testMultipleIncludes'); + const config = graphQLRC.getProject('testMultipleIncludes'); const fragmentDefinitions = await cache.getFragmentDefinitions(config); expect(fragmentDefinitions.get('testFragment')).not.toBeUndefined(); }); it('handles empty includes', async () => { - const config = graphQLRC.getProjectConfig('testNoIncludes'); + const config = graphQLRC.getProject('testNoIncludes'); const fragmentDefinitions = await cache.getFragmentDefinitions(config); expect(fragmentDefinitions.get('testFragment')).toBeUndefined(); }); it('handles non-existent includes', async () => { - const config = graphQLRC.getProjectConfig('testBadIncludes'); + const config = graphQLRC.getProject('testBadIncludes'); const fragmentDefinitions = await cache.getFragmentDefinitions(config); expect(fragmentDefinitions.get('testFragment')).toBeUndefined(); }); diff --git a/packages/graphql-language-service-server/src/__tests__/MessageProcessor-test.ts b/packages/graphql-language-service-server/src/__tests__/MessageProcessor-test.ts index be5210e581b..fa3f50bd55d 100644 --- a/packages/graphql-language-service-server/src/__tests__/MessageProcessor-test.ts +++ b/packages/graphql-language-service-server/src/__tests__/MessageProcessor-test.ts @@ -34,8 +34,8 @@ describe('MessageProcessor', () => { // @ts-ignore getGraphQLConfig() { return { - configDir: __dirname, - getProjectNameForFile() { + dirpath: __dirname, + getProjectForFile() { return null; }, }; diff --git a/packages/graphql-language-service-types/package.json b/packages/graphql-language-service-types/package.json index b645d29f277..efddf81284c 100644 --- a/packages/graphql-language-service-types/package.json +++ b/packages/graphql-language-service-types/package.json @@ -27,7 +27,7 @@ "graphql": "^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" }, "dependencies": { - "graphql-config": "2.2.1" + "graphql-config": "3.0.0-alpha.17" }, "devDependencies": { "vscode-languageserver-types": "3.15.0" diff --git a/packages/graphql-language-service-utils/package.json b/packages/graphql-language-service-utils/package.json index 8762f9fdacf..215ca692ff4 100644 --- a/packages/graphql-language-service-utils/package.json +++ b/packages/graphql-language-service-utils/package.json @@ -31,7 +31,7 @@ "graphql": "^0.12.0 || ^0.13.0 || ^14.0.0" }, "dependencies": { - "graphql-config": "2.2.1", + "graphql-config": "3.0.0-alpha.17", "graphql-language-service-types": "^1.6.0-alpha.1" }, "devDependencies": { diff --git a/packages/graphql-language-service/README.md b/packages/graphql-language-service/README.md index 0c4beb26003..3970e0f43c5 100644 --- a/packages/graphql-language-service/README.md +++ b/packages/graphql-language-service/README.md @@ -38,9 +38,9 @@ After pulling the latest changes from this repo, be sure to run `yarn run build` The library includes a node executable file which you can find in `./node_modules/.bin/graphql.js` after installation. -### GraphQL configuration file (`.graphqlconfig`) +### GraphQL configuration file (`.graphqlrc.yml`) -Check out [graphql-config](https://github.com/graphcool/graphql-config) +Check out [graphql-config](https://graphql-config.com/docs/introduction) The graphql features we support are: @@ -80,7 +80,7 @@ Options: autocomplete suggestions. If omitted, the last column number will be used. [number] - -c, --configDir Path to the .graphqlrc configuration file. + -c, --configDir Path to the .graphqlrc.yml configuration file. Walks up the directory tree from the provided config directory, or the current working directory, until a .graphqlrc is found or the root directory is found. @@ -96,23 +96,23 @@ Commands: "server, validate, autocomplete, outline" GraphQL Language Service currently communicates via Stream transport with the IDE server. GraphQL server will receive/send RPC messages to perform language service features, while caching the necessary GraphQL artifacts such as fragment definitions, GraphQL schemas etc. More about the server interface and RPC message format below. -The IDE server should launch a separate GraphQL server with its own child process for each `.graphqlconfig` file the IDE finds (using the nearest ancestor directory relative to the file currently being edited): +The IDE server should launch a separate GraphQL server with its own child process for each `.graphqlrc.yml` file the IDE finds (using the nearest ancestor directory relative to the file currently being edited): ``` ./application ./productA - .graphqlconfig + .graphqlrc.yml ProductAQuery.graphql ProductASchema.graphql ./productB - .graphqlconfig + .graphqlrc.yml ProductBQuery.graphql ProductBSchema.graphql ``` -A separate GraphQL server should be instantiated for `ProductA` and `ProductB`, each with its own `.graphqlconfig` file, as illustrated in the directory structure above. +A separate GraphQL server should be instantiated for `ProductA` and `ProductB`, each with its own `.graphqlrc.yml` file, as illustrated in the directory structure above. The IDE server should manage the lifecycle of the GraphQL server. Ideally, the IDE server should spawn a child process for each of the GraphQL Language Service processes necessary, and gracefully exit the processes as the IDE closes. In case of errors or a sudden halt the GraphQL Language Service will close as the stream from the IDE closes. diff --git a/packages/graphql-language-service/package.json b/packages/graphql-language-service/package.json index 3e9f60ab157..6ad3b52c20d 100644 --- a/packages/graphql-language-service/package.json +++ b/packages/graphql-language-service/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@babel/polyfill": "7.8.3", - "graphql-config": "2.2.1", + "graphql-config": "3.0.0-alpha.17", "graphql-language-service-interface": "^2.4.0-alpha.1", "graphql-language-service-server": "^2.4.0-alpha.1", "graphql-language-service-utils": "^2.4.0-alpha.1", diff --git a/yarn.lock b/yarn.lock index 77908e80803..958434812b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,17 @@ # yarn lockfile v1 +"@ardatan/graphql-tools@4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@ardatan/graphql-tools/-/graphql-tools-4.1.0.tgz#183508ef4e3d4966f763cb1634a81be1c1255f8d" + integrity sha512-0b+KH5RZN9vCMpEjxrwFwZ7v3K6QDjs1EH+R6eRrgKMR2X274JWqYraHKLWE1uJ8iwrkRaOYfCV12jLVuvWS+A== + dependencies: + apollo-link "^1.2.3" + apollo-utilities "^1.0.1" + deprecated-decorator "^0.1.6" + iterall "^1.1.3" + uuid "^3.1.0" + "@babel/cli@7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.8.4.tgz#505fb053721a98777b2b175323ea4f090b7d3c1c" @@ -1343,6 +1354,76 @@ unique-filename "^1.1.1" which "^1.3.1" +"@graphql-toolkit/common@0.9.1-alpha-b002745.19+b002745": + version "0.9.1-alpha-b002745.19" + resolved "https://registry.yarnpkg.com/@graphql-toolkit/common/-/common-0.9.1-alpha-b002745.19.tgz#a5704c7dd12a80a83ae4c4f269c2fd6684cf610b" + integrity sha512-NmlxhWqvi/ZotFS64g9zXAPAn0oCSlKQhpqqDQhXAKxgnAkLz8D73qlTSiiQ6CuuCzl6LJ0CZ6Y74mzRIm/nvA== + dependencies: + "@ardatan/graphql-tools" "4.1.0" + aggregate-error "3.0.1" + lodash "4.17.15" + +"@graphql-toolkit/core@0.9.1-alpha-b002745.19+b002745": + version "0.9.1-alpha-b002745.19" + resolved "https://registry.yarnpkg.com/@graphql-toolkit/core/-/core-0.9.1-alpha-b002745.19.tgz#3711b214f0c79c731270a9c821d813dc3263b110" + integrity sha512-6N30qBJTyWc2oNk2ij/p4hpe1ZXbxJj1yKytVNiiObaRd80LKsfJ9aPpj3ZE9svdsWEYuHUgNple1reuzOYNFQ== + dependencies: + "@graphql-toolkit/common" "0.9.1-alpha-b002745.19+b002745" + "@graphql-toolkit/file-loading" "0.9.1-alpha-b002745.19+b002745" + "@graphql-toolkit/schema-merging" "0.9.1-alpha-b002745.19+b002745" + aggregate-error "3.0.1" + globby "11.0.0" + import-from "^3.0.0" + is-glob "4.0.1" + resolve-from "5.0.0" + tslib "1.10.0" + unixify "1.0.0" + valid-url "1.0.9" + +"@graphql-toolkit/file-loading@0.9.1-alpha-b002745.19+b002745": + version "0.9.1-alpha-b002745.19" + resolved "https://registry.yarnpkg.com/@graphql-toolkit/file-loading/-/file-loading-0.9.1-alpha-b002745.19.tgz#f4744250b2efc292d75f551ed0102a6aeb9c80bd" + integrity sha512-G+l1JPTv3c3rg7081Szs0UTw3yRtOGPcL9WNmAqFAi8xJ7vUniz209BneY5MX4p/eCg/Na8jY2fu65HwCpXq+A== + dependencies: + globby "11.0.0" + unixify "1.0.0" + +"@graphql-toolkit/graphql-file-loader@0.9.1-alpha-b002745.19+b002745": + version "0.9.1-alpha-b002745.19" + resolved "https://registry.yarnpkg.com/@graphql-toolkit/graphql-file-loader/-/graphql-file-loader-0.9.1-alpha-b002745.19.tgz#285992e4081a8f70b947becea6d808adbeb20cdd" + integrity sha512-CApSPPaXidb7pyZO7nknN1LlE4hawZuJH+84ggevLABKmbyCuLd53ghL0kErwnNExk6sxnAF6POor96KUUMzSg== + dependencies: + "@graphql-toolkit/common" "0.9.1-alpha-b002745.19+b002745" + tslib "1.10.0" + +"@graphql-toolkit/json-file-loader@0.9.1-alpha-b002745.19+b002745": + version "0.9.1-alpha-b002745.19" + resolved "https://registry.yarnpkg.com/@graphql-toolkit/json-file-loader/-/json-file-loader-0.9.1-alpha-b002745.19.tgz#899668f33b61d142366216e44d7abb36ae95610d" + integrity sha512-/AIkKRCEIEvAgNB0Du7lz0a63qSnv4N+RW5vs5UPEs6JfVdjKDyN7oJLpYIn/eAP2RhosIseN68D5ht2rFmsog== + dependencies: + "@graphql-toolkit/common" "0.9.1-alpha-b002745.19+b002745" + tslib "1.10.0" + +"@graphql-toolkit/schema-merging@0.9.1-alpha-b002745.19+b002745": + version "0.9.1-alpha-b002745.19" + resolved "https://registry.yarnpkg.com/@graphql-toolkit/schema-merging/-/schema-merging-0.9.1-alpha-b002745.19.tgz#0be92069e3a3d0e3f6e89457205263a45f3b1187" + integrity sha512-jalJA8v4JbbsPM5EMx3292CLKbOM9X6n+K0HdBN6OAFTKryBPfoZw1npn85a7QuENRrf+qDl0GIskw78Qs/XKg== + dependencies: + "@graphql-toolkit/common" "0.9.1-alpha-b002745.19+b002745" + deepmerge "4.2.2" + graphql-tools "4.0.6" + tslib "1.10.0" + +"@graphql-toolkit/url-loader@0.9.1-alpha-b002745.19+b002745": + version "0.9.1-alpha-b002745.19" + resolved "https://registry.yarnpkg.com/@graphql-toolkit/url-loader/-/url-loader-0.9.1-alpha-b002745.19.tgz#54f4bb194031c372d6aa9c2846a99b961c0bd83e" + integrity sha512-VNNcaq6iPzeDi5063nMqh9OGWnzdSnijLBAlRz68Ghbf7MqHEnMR//pw39fGGc/C6aDTu9w+IJZEKuYQxmc+5g== + dependencies: + "@graphql-toolkit/common" "0.9.1-alpha-b002745.19+b002745" + cross-fetch "3.0.4" + tslib "1.10.0" + valid-url "1.0.9" + "@hapi/address@^2.1.2": version "2.1.4" resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5" @@ -2410,11 +2491,32 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" +"@nodelib/fs.scandir@2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" + integrity sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw== + dependencies: + "@nodelib/fs.stat" "2.0.3" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.3", "@nodelib/fs.stat@^2.0.2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz#34dc5f4cabbc720f4e60f75a747e7ecd6c175bd3" + integrity sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA== + "@nodelib/fs.stat@^1.1.2": version "1.1.3" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== +"@nodelib/fs.walk@^1.2.3": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz#011b9202a70a6366e436ca5c065844528ab04976" + integrity sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ== + dependencies: + "@nodelib/fs.scandir" "2.1.3" + fastq "^1.6.0" + "@octokit/auth-token@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.4.0.tgz#b64178975218b99e4dfe948253f0673cbbb59d9f" @@ -3514,6 +3616,13 @@ "@webassemblyjs/wast-parser" "1.8.5" "@xtuc/long" "4.2.2" +"@wry/equality@^0.1.2": + version "0.1.9" + resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.1.9.tgz#b13e18b7a8053c6858aa6c85b54911fb31e3a909" + integrity sha512-mB6ceGjpMGz1ZTza8HYnrPGos2mC6So4NhS1PtZ8s4Qt0K7fBiIGhpSxUbQmhwcSWE3no+bYxmI2OL6KuXYmoQ== + dependencies: + tslib "^1.9.3" + "@xtuc/ieee754@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" @@ -3635,7 +3744,7 @@ agentkeepalive@^3.4.1: dependencies: humanize-ms "^1.2.1" -aggregate-error@^3.0.0: +aggregate-error@3.0.1, aggregate-error@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.0.1.tgz#db2fe7246e536f40d9b5442a39e117d7dd6a24e0" integrity sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA== @@ -3835,6 +3944,26 @@ anymatch@^3.0.3, anymatch@~3.1.1: normalize-path "^3.0.0" picomatch "^2.0.4" +apollo-link@^1.2.3: + version "1.2.13" + resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.13.tgz#dff00fbf19dfcd90fddbc14b6a3f9a771acac6c4" + integrity sha512-+iBMcYeevMm1JpYgwDEIDt/y0BB7VWyvlm/7x+TIPNLHCTCMgcEgDuW5kH86iQZWo0I7mNwQiTOz+/3ShPFmBw== + dependencies: + apollo-utilities "^1.3.0" + ts-invariant "^0.4.0" + tslib "^1.9.3" + zen-observable-ts "^0.8.20" + +apollo-utilities@^1.0.1, apollo-utilities@^1.3.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.3.3.tgz#f1854715a7be80cd810bc3ac95df085815c0787c" + integrity sha512-F14aX2R/fKNYMvhuP2t9GD9fggID7zp5I96MF5QeKYWDWTrkRdHRp4+SVfXUVN+cXOaB/IebfvRtzPf25CM0zw== + dependencies: + "@wry/equality" "^0.1.2" + fast-json-stable-stringify "^2.0.0" + ts-invariant "^0.4.0" + tslib "^1.10.0" + app-root-dir@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/app-root-dir/-/app-root-dir-1.0.2.tgz#38187ec2dea7577fff033ffcb12172692ff6e118" @@ -3968,6 +4097,11 @@ array-union@^1.0.1, array-union@^1.0.2: dependencies: array-uniq "^1.0.1" +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" @@ -5906,7 +6040,7 @@ corejs-upgrade-webpack-plugin@^2.2.0: resolve-from "^5.0.0" webpack "^4.38.0" -cosmiconfig@^5.0.0, cosmiconfig@^5.1.0, cosmiconfig@^5.2.0, cosmiconfig@^5.2.1: +cosmiconfig@5.2.1, cosmiconfig@^5.0.0, cosmiconfig@^5.1.0, cosmiconfig@^5.2.0, cosmiconfig@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== @@ -5973,13 +6107,13 @@ cross-env@^7.0.0: dependencies: cross-spawn "^7.0.1" -cross-fetch@2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.2.tgz#a47ff4f7fc712daba8f6a695a11c948440d45723" - integrity sha1-pH/09/xxLauo9qaVoRyUhEDUVyM= +cross-fetch@3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.4.tgz#7bef7020207e684a7638ef5f2f698e24d9eb283c" + integrity sha512-MSHgpjQqgbT/94D4CyADeNoYh52zMkCX4pcJvPP5WqPsLFMKjr2TCMg381ox5qI0ii2dPwaLx/00477knXqXVw== dependencies: - node-fetch "2.1.2" - whatwg-fetch "2.0.4" + node-fetch "2.6.0" + whatwg-fetch "3.0.0" cross-spawn@6.0.5, cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" @@ -6457,7 +6591,7 @@ deep-object-diff@^1.1.0: resolved "https://registry.yarnpkg.com/deep-object-diff/-/deep-object-diff-1.1.0.tgz#d6fabf476c2ed1751fc94d5ca693d2ed8c18bc5a" integrity sha512-b+QLs5vHgS+IoSNcUE4n9HP2NwcHj7aqnJWsjPtuG75Rh5TOaGt0OjAYInh77d5T16V5cRDC+Pw/6ZZZiETBGw== -deepmerge@^4.0.0: +deepmerge@4.2.2, deepmerge@^4.0.0: version "4.2.2" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== @@ -6546,6 +6680,11 @@ depd@~1.1.2: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= +deprecated-decorator@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz#00966317b7a12fe92f3cc831f7583af329b86c37" + integrity sha1-AJZjF7ehL+kvPMgx91g68ym4bDc= + deprecation@^2.0.0, deprecation@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" @@ -6652,6 +6791,13 @@ dir-glob@^2.2.2: dependencies: path-type "^3.0.0" +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + dns-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" @@ -7647,6 +7793,17 @@ fast-glob@^2.0.2, fast-glob@^2.2.6: merge2 "^1.2.3" micromatch "^3.1.10" +fast-glob@^3.0.3, fast-glob@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.1.1.tgz#87ee30e9e9f3eb40d6f254a7997655da753d7c82" + integrity sha512-nTCREpBY8w8r+boyFYAx21iL6faSsQynliPHM4Uf56SbkyohCNxpVPEH9xrF5TXKy+IsjkPUHDKiUkzBVRXn9g== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.0" + merge2 "^1.3.0" + micromatch "^4.0.2" + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -7664,6 +7821,13 @@ fast-url-parser@1.1.3: dependencies: punycode "^1.3.2" +fastq@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.6.0.tgz#4ec8a38f4ac25f21492673adb7eae9cfef47d1c2" + integrity sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA== + dependencies: + reusify "^1.0.0" + fault@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.4.tgz#eafcfc0a6d214fc94601e170df29954a4f842f13" @@ -8396,7 +8560,14 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-parent@^5.0.0, glob-parent@~5.1.0: +glob-parent@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954" + integrity sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg== + dependencies: + is-glob "^4.0.1" + +glob-parent@^5.1.0, glob-parent@~5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== @@ -8537,6 +8708,32 @@ globalthis@^1.0.0: dependencies: define-properties "^1.1.3" +globby@10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.1.tgz#4782c34cb75dd683351335c5829cc3420e606b22" + integrity sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A== + dependencies: + "@types/glob" "^7.1.1" + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.0.3" + glob "^7.1.3" + ignore "^5.1.1" + merge2 "^1.2.3" + slash "^3.0.0" + +globby@11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.0.tgz#56fd0e9f0d4f8fb0c456f1ab0dee96e1380bc154" + integrity sha512-iuehFnR3xu5wBBtm4xi0dMe92Ob87ufyu/dHwpDYfbcpYpIbrO5OnS8M1vWvrBhSGEJ3/Ecj7gnX76P8YxpPEg== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" + globby@8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" @@ -8611,6 +8808,21 @@ graphql-config@2.2.1: lodash "^4.17.4" minimatch "^3.0.4" +graphql-config@3.0.0-alpha.17: + version "3.0.0-alpha.17" + resolved "https://registry.yarnpkg.com/graphql-config/-/graphql-config-3.0.0-alpha.17.tgz#c671280101d81717aedf3edc6691760383597e98" + integrity sha512-y94h+yHkFeVJ/0cdm7eiSsx4SGmXMWvIKf/IFWtD+QUD3WE+yNGxYnCf8gXxZlD/vFAOVB9iBPJ+1yhKcAaAhQ== + dependencies: + "@graphql-toolkit/common" "0.9.1-alpha-b002745.19+b002745" + "@graphql-toolkit/core" "0.9.1-alpha-b002745.19+b002745" + "@graphql-toolkit/graphql-file-loader" "0.9.1-alpha-b002745.19+b002745" + "@graphql-toolkit/json-file-loader" "0.9.1-alpha-b002745.19+b002745" + "@graphql-toolkit/schema-merging" "0.9.1-alpha-b002745.19+b002745" + "@graphql-toolkit/url-loader" "0.9.1-alpha-b002745.19+b002745" + cosmiconfig "5.2.1" + globby "10.0.1" + minimatch "3.0.4" + graphql-import@^0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/graphql-import/-/graphql-import-0.7.1.tgz#4add8d91a5f752d764b0a4a7a461fcd93136f223" @@ -8675,6 +8887,17 @@ graphql-request@^1.5.0: dependencies: cross-fetch "2.2.2" +graphql-tools@4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-4.0.6.tgz#0e729e73db05ade3df10a2f92511be544972a844" + integrity sha512-jHLQw8x3xmSNRBCsaZqelXXsFfUSUSktSCUP8KYHiX1Z9qEuwcMpAf+FkdBzk8aTAFqOlPdNZ3OI4DKKqGKUqg== + dependencies: + apollo-link "^1.2.3" + apollo-utilities "^1.0.1" + deprecated-decorator "^0.1.6" + iterall "^1.1.3" + uuid "^3.1.0" + graphql@14.5.8: version "14.5.8" resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.5.8.tgz#504f3d3114cb9a0a3f359bbbcf38d9e5bf6a6b3c" @@ -9216,6 +9439,11 @@ ignore@^4.0.3, ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== +ignore@^5.1.1, ignore@^5.1.4: + version "5.1.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.4.tgz#84b7b3dbe64552b6ef0eca99f6743dbec6d97adf" + integrity sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A== + immer@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/immer/-/immer-1.10.0.tgz#bad67605ba9c810275d91e1c2a47d4582e98286d" @@ -9244,7 +9472,7 @@ import-fresh@^3.0.0, import-fresh@^3.1.0: parent-module "^1.0.0" resolve-from "^4.0.0" -import-from@3.0.0: +import-from@3.0.0, import-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/import-from/-/import-from-3.0.0.tgz#055cfec38cd5a27d8057ca51376d7d3bf0891966" integrity sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ== @@ -9695,6 +9923,13 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== +is-glob@4.0.1, is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" @@ -9709,13 +9944,6 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - is-hexadecimal@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" @@ -10100,7 +10328,7 @@ istanbul-reports@^3.0.0: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -iterall@^1.2.2: +iterall@^1.1.3, iterall@^1.2.2: version "1.3.0" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea" integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg== @@ -11802,7 +12030,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.2.3: +merge2@^1.2.3, merge2@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== @@ -12315,14 +12543,9 @@ node-fetch-npm@^2.0.2: json-parse-better-errors "^1.0.0" safe-buffer "^5.1.1" -node-fetch@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" - integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= - -node-fetch@^2.2.0, node-fetch@^2.3.0, node-fetch@^2.5.0, node-fetch@^2.6.0: +node-fetch@2.6.0, node-fetch@^2.2.0, node-fetch@^2.3.0, node-fetch@^2.5.0, node-fetch@^2.6.0: version "2.6.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== node-forge@0.9.0: @@ -15224,6 +15447,11 @@ retry@^0.12.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= +reusify@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + rgb-regex@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1" @@ -15275,6 +15503,11 @@ run-async@^2.2.0: dependencies: is-promise "^2.1.0" +run-parallel@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" + integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== + run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" @@ -16816,6 +17049,13 @@ ts-dedent@^1.1.0: resolved "https://registry.yarnpkg.com/ts-dedent/-/ts-dedent-1.1.1.tgz#68fad040d7dbd53a90f545b450702340e17d18f3" integrity sha512-UGTRZu1evMw4uTPyYF66/KFd22XiU+jMaIuHrkIHQ2GivAXVlLV0v/vHrpOuTRf9BmpNHi/SO7Vd0rLu0y57jg== +ts-invariant@^0.4.0: + version "0.4.4" + resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.4.4.tgz#97a523518688f93aafad01b0e80eb803eb2abd86" + integrity sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA== + dependencies: + tslib "^1.9.3" + ts-jest@^25.2.0: version "25.2.0" resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-25.2.0.tgz#dfd87c2b71ef4867f5a0a44f40cb9c67e02991ac" @@ -16837,7 +17077,7 @@ ts-pnp@^1.1.2: resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.1.5.tgz#840e0739c89fce5f3abd9037bb091dbff16d9dec" integrity sha512-ti7OGMOUOzo66wLF3liskw6YQIaSsBgc4GOAlWRnIEj8htCxJUxskanMUoJOD6MDCRAXo36goXJZch+nOS0VMA== -tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: +tslib@1.10.0, tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== @@ -17070,6 +17310,13 @@ universalify@^0.1.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== +unixify@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unixify/-/unixify-1.0.0.tgz#3a641c8c2ffbce4da683a5c70f03a462940c2090" + integrity sha1-OmQcjC/7zk2mg6XHDwOkYpQMIJA= + dependencies: + normalize-path "^2.1.1" + unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -17225,10 +17472,10 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid@^3.0.1, uuid@^3.3.2, uuid@^3.3.3: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== +uuid@^3.0.1, uuid@^3.1.0, uuid@^3.3.2, uuid@^3.3.3: + version "3.3.3" + resolved "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" + integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== v8-compile-cache@2.0.3: version "2.0.3" @@ -17256,6 +17503,11 @@ v8flags@^3.1.1: dependencies: homedir-polyfill "^1.0.1" +valid-url@1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200" + integrity sha1-HBRHm0DxOXp1eC8RXkCGRHQzogA= + validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.3: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -17630,10 +17882,10 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3, whatwg-encoding@^1.0.5: dependencies: iconv-lite "0.4.24" -whatwg-fetch@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" - integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== +whatwg-fetch@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" + integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: version "2.3.0" @@ -18093,3 +18345,16 @@ yauzl@2.4.1: integrity sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU= dependencies: fd-slicer "~1.0.1" + +zen-observable-ts@^0.8.20: + version "0.8.20" + resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.20.tgz#44091e335d3fcbc97f6497e63e7f57d5b516b163" + integrity sha512-2rkjiPALhOtRaDX6pWyNqK1fnP5KkJJybYebopNSn6wDG1lxBoFs2+nwwXKoA6glHIrtwrfBBy6da0stkKtTAA== + dependencies: + tslib "^1.9.3" + zen-observable "^0.8.0" + +zen-observable@^0.8.0: + version "0.8.15" + resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" + integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==