@graphql-tools/code-file-loader
Advanced tools
Comparing version 5.0.1-alpha-78275ec.0 to 5.0.1-alpha-7ecf9b1.0
@@ -5,6 +5,6 @@ import { DocumentNode, GraphQLSchema } from 'graphql'; | ||
filepath: string; | ||
}): Promise<GraphQLSchema | DocumentNode>; | ||
}): Promise<DocumentNode | GraphQLSchema>; | ||
export declare function pickExportFromModuleSync({ module, filepath }: { | ||
module: any; | ||
filepath: string; | ||
}): GraphQLSchema | DocumentNode; | ||
}): DocumentNode | GraphQLSchema; |
@@ -25,3 +25,3 @@ 'use strict'; | ||
const graphql = require('graphql'); | ||
const common = require('@graphql-tools/common'); | ||
const utils = require('@graphql-tools/utils'); | ||
const graphqlTagPluck = require('@graphql-tools/graphql-tag-pluck'); | ||
@@ -149,3 +149,3 @@ | ||
canLoadSync(pointer, options) { | ||
if (common.isValidPath(pointer) && options.path && options.fs) { | ||
if (utils.isValidPath(pointer) && options.path && options.fs) { | ||
const { resolve, isAbsolute } = options.path; | ||
@@ -174,3 +174,3 @@ if (FILE_EXTENSIONS.find(extension => pointer.endsWith(extension))) { | ||
catch (e) { | ||
common.debugLog(`Failed to load schema from code file "${normalizedFilePath}": ${e.message}`); | ||
utils.debugLog(`Failed to load schema from code file "${normalizedFilePath}": ${e.message}`); | ||
errors.push(e); | ||
@@ -182,3 +182,3 @@ } | ||
if (options && options.require) { | ||
await Promise.all(common.asArray(options.require).map(m => new Promise(function (resolve) { resolve(_interopNamespace(require(m))); }))); | ||
await Promise.all(utils.asArray(options.require).map(m => new Promise(function (resolve) { resolve(_interopNamespace(require(m))); }))); | ||
} | ||
@@ -212,3 +212,3 @@ const loaded = await tryToLoadFromExport(normalizedFilePath); | ||
catch (e) { | ||
common.debugLog(`Failed to load schema from code file "${normalizedFilePath}": ${e.message}`); | ||
utils.debugLog(`Failed to load schema from code file "${normalizedFilePath}": ${e.message}`); | ||
errors.push(e); | ||
@@ -220,3 +220,3 @@ } | ||
if (options && options.require) { | ||
common.asArray(options.require).forEach(m => require(m)); | ||
utils.asArray(options.require).forEach(m => require(m)); | ||
} | ||
@@ -240,3 +240,3 @@ const loaded = tryToLoadFromExportSync(normalizedFilePath); | ||
function parseSDL({ pointer, sdl, options }) { | ||
return common.parseGraphQLSDL(pointer, sdl, options); | ||
return utils.parseGraphQLSDL(pointer, sdl, options); | ||
} | ||
@@ -247,3 +247,3 @@ function resolveSource(pointer, value, options) { | ||
location: pointer, | ||
rawSDL: common.printSchemaWithDirectives(value, options), | ||
rawSDL: utils.printSchemaWithDirectives(value, options), | ||
schema: value, | ||
@@ -260,3 +260,3 @@ }; | ||
else if (typeof value === 'string') { | ||
return common.parseGraphQLSDL(pointer, value, options); | ||
return utils.parseGraphQLSDL(pointer, value, options); | ||
} | ||
@@ -263,0 +263,0 @@ return null; |
@@ -1,2 +0,2 @@ | ||
import { SchemaPointerSingle, DocumentPointerSingle, SingleFileOptions, Source, UniversalLoader } from '@graphql-tools/common'; | ||
import { SchemaPointerSingle, DocumentPointerSingle, SingleFileOptions, Source, UniversalLoader } from '@graphql-tools/utils'; | ||
import { GraphQLTagPluckOptions } from '@graphql-tools/graphql-tag-pluck'; | ||
@@ -3,0 +3,0 @@ export declare type CodeFileLoaderOptions = { |
import { isSchema, parse, buildClientSchema, Kind, print } from 'graphql'; | ||
import { isValidPath, parseGraphQLSDL, debugLog, asArray, printSchemaWithDirectives } from '@graphql-tools/common'; | ||
import { isValidPath, parseGraphQLSDL, debugLog, asArray, printSchemaWithDirectives } from '@graphql-tools/utils'; | ||
import { gqlPluckFromCodeString, gqlPluckFromCodeStringSync } from '@graphql-tools/graphql-tag-pluck'; | ||
@@ -4,0 +4,0 @@ |
{ | ||
"name": "@graphql-tools/code-file-loader", | ||
"version": "5.0.1-alpha-78275ec.0", | ||
"version": "5.0.1-alpha-7ecf9b1.0", | ||
"description": "A set of utils for faster development of GraphQL tools", | ||
"peerDependencies": { | ||
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" | ||
"graphql": "^14.0.0 || ^15.0.0" | ||
}, | ||
"dependencies": { | ||
"@graphql-tools/common": "5.0.1-alpha-78275ec.0", | ||
"@graphql-tools/graphql-tag-pluck": "5.0.1-alpha-78275ec.0", | ||
"@graphql-tools/utils": "5.0.1-alpha-7ecf9b1.0", | ||
"@graphql-tools/graphql-tag-pluck": "5.0.1-alpha-7ecf9b1.0", | ||
"tslib": "1.11.1" | ||
@@ -12,0 +12,0 @@ }, |
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
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
54820
+ Added@graphql-tools/graphql-tag-pluck@5.0.1-alpha-7ecf9b1.0(transitive)
+ Added@graphql-tools/utils@5.0.1-alpha-7ecf9b1.0(transitive)
+ Addedlodash@4.17.21(transitive)
- Removed@babel/runtime@7.26.0(transitive)
- Removed@graphql-tools/common@5.0.1-alpha-78275ec.0(transitive)
- Removed@graphql-tools/graphql-tag-pluck@5.0.1-alpha-78275ec.0(transitive)
- Removed@graphql-tools/schema-stitching@5.0.1-alpha-78275ec.0(transitive)
- Removed@wry/equality@0.1.11(transitive)
- Removedapollo-link@1.2.14(transitive)
- Removedapollo-link-http-common@0.2.16(transitive)
- Removedapollo-upload-client@13.0.0(transitive)
- Removedapollo-utilities@1.3.4(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcross-fetch@3.0.4(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removedextract-files@8.1.0(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedform-data@3.0.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removednode-fetch@2.6.0(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedts-invariant@0.4.4(transitive)
- Removedwhatwg-fetch@3.0.0(transitive)
- Removedzen-observable@0.8.15(transitive)
- Removedzen-observable-ts@0.8.21(transitive)
Updated@graphql-tools/graphql-tag-pluck@5.0.1-alpha-7ecf9b1.0