Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@graphql-tools/code-file-loader

Package Overview
Dependencies
Maintainers
3
Versions
1113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/code-file-loader - npm Package Compare versions

Comparing version 5.0.1-alpha-78275ec.0 to 5.0.1-alpha-7ecf9b1.0

4

exports.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc