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

@graphql-toolkit/graphql-file-loader

Package Overview
Dependencies
Maintainers
2
Versions
686
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-toolkit/graphql-file-loader - npm Package Compare versions

Comparing version 0.6.1-alpha-cee1e98.4 to 0.6.2-alpha.0

1

dist/commonjs/load-from-gql-file.d.ts
import { Source, UniversalLoader, DocumentPointerSingle, SchemaPointerSingle } from '@graphql-toolkit/common';
export declare type GraphQLFileLoaderOptions = {
skipGraphQLImport: boolean;
cwd?: string;
};

@@ -5,0 +6,0 @@ export declare class GraphQLFileLoader implements UniversalLoader<GraphQLFileLoaderOptions> {

7

dist/commonjs/load-from-gql-file.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const graphql_1 = require("graphql");
const path_1 = require("path");
const graphql_1 = require("graphql");
const GQL_EXTENSIONS = ['.gql', '.graphql', '.graphqls'];

@@ -16,7 +16,8 @@ class GraphQLFileLoader {

const { readFileSync } = eval(`require('fs')`);
const content = readFileSync(pointer, 'utf-8').trim();
const normalizedFilePath = path_1.isAbsolute(pointer) ? pointer : path_1.resolve(options.cwd || process.cwd(), pointer);
const content = readFileSync(normalizedFilePath, 'utf-8').trim();
if (content && content !== '') {
if (!options.skipGraphQLImport && /^\#.*import /i.test(content.trimLeft())) {
const { importSchema } = eval(`require('graphql-import')`);
const importedSchema = importSchema(pointer);
const importedSchema = importSchema(normalizedFilePath);
return {

@@ -23,0 +24,0 @@ location: pointer,

import { Source, UniversalLoader, DocumentPointerSingle, SchemaPointerSingle } from '@graphql-toolkit/common';
export declare type GraphQLFileLoaderOptions = {
skipGraphQLImport: boolean;
cwd?: string;
};

@@ -5,0 +6,0 @@ export declare class GraphQLFileLoader implements UniversalLoader<GraphQLFileLoaderOptions> {

@@ -1,3 +0,3 @@

import { extname } from 'path';
import { parse, Source as GraphQLSource } from 'graphql';
import { extname, isAbsolute, resolve } from 'path';
const GQL_EXTENSIONS = ['.gql', '.graphql', '.graphqls'];

@@ -14,7 +14,8 @@ export class GraphQLFileLoader {

const { readFileSync } = eval(`require('fs')`);
const content = readFileSync(pointer, 'utf-8').trim();
const normalizedFilePath = isAbsolute(pointer) ? pointer : resolve(options.cwd || process.cwd(), pointer);
const content = readFileSync(normalizedFilePath, 'utf-8').trim();
if (content && content !== '') {
if (!options.skipGraphQLImport && /^\#.*import /i.test(content.trimLeft())) {
const { importSchema } = eval(`require('graphql-import')`);
const importedSchema = importSchema(pointer);
const importedSchema = importSchema(normalizedFilePath);
return {

@@ -21,0 +22,0 @@ location: pointer,

{
"name": "@graphql-toolkit/graphql-file-loader",
"version": "0.6.1-alpha-cee1e98.4+cee1e98",
"version": "0.6.2-alpha.0+aab2758",
"description": "A set of utils for faster development of GraphQL tools",

@@ -28,3 +28,3 @@ "repository": "git@github.com:dotansimha/graphql-toolkit.git",

"dependencies": {
"@graphql-toolkit/common": "0.6.1-alpha-cee1e98.4+cee1e98",
"@graphql-toolkit/common": "0.6.2-alpha.0+aab2758",
"graphql-import": "0.7.1"

@@ -35,3 +35,3 @@ },

},
"gitHead": "cee1e98ff0ec3e2a47176748797dbc816506533a"
"gitHead": "aab275825969724eae67e2df0bb55472c90f7e43"
}

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