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

@graphql-toolkit/code-file-loader

Package Overview
Dependencies
Maintainers
3
Versions
695
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.6.8-alpha-23bbb51.1 to 0.6.8-alpha-2cde5e8.4

4

dist/commonjs/extract-document-string-from-code-file.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const graphql_1 = require("graphql");
const graphql_tag_pluck_1 = require("graphql-tag-pluck");
function calculateOptions(options) {

@@ -35,3 +34,4 @@ if (!options || !options.tagPluck) {

try {
return (await graphql_tag_pluck_1.gqlPluckFromFile(source.name, calculateOptions(options))) || null;
const { gqlPluckFromFile } = eval(`require('graphql-tag-pluck')`);
return (await gqlPluckFromFile(source.name, calculateOptions(options))) || null;
}

@@ -38,0 +38,0 @@ catch (e) {

@@ -7,3 +7,2 @@ "use strict";

const common_1 = require("@graphql-toolkit/common");
const fs_1 = require("fs");
function isSchemaText(obj) {

@@ -53,3 +52,3 @@ return typeof obj === 'string';

if (require && require.cache) {
filePath = require.resolve(filePath);
filePath = eval(`require.resolve('${filePath}')`);
if (require.cache[filePath]) {

@@ -59,3 +58,3 @@ delete require.cache[filePath];

}
const rawExports = await Promise.resolve().then(() => require(filePath));
const rawExports = await eval(`require('${filePath}');`);
if (rawExports) {

@@ -86,3 +85,4 @@ let rawExport = rawExports.default || rawExports.schema || rawExports;

async function tryToLoadFromCodeAst(filePath, options) {
const content = fs_1.readFileSync(filePath, 'utf-8');
const { readFileSync } = eval(`require('fs')`);
const content = readFileSync(filePath, 'utf-8');
const foundDoc = await extract_document_string_from_code_file_1.extractDocumentStringFromCodeFile(new graphql_1.Source(content, filePath), options || {});

@@ -89,0 +89,0 @@ if (foundDoc) {

import { parse } from 'graphql';
import { gqlPluckFromFile } from 'graphql-tag-pluck';
function calculateOptions(options) {

@@ -33,2 +32,3 @@ if (!options || !options.tagPluck) {

try {
const { gqlPluckFromFile } = eval(`require('graphql-tag-pluck')`);
return (await gqlPluckFromFile(source.name, calculateOptions(options))) || null;

@@ -35,0 +35,0 @@ }

@@ -5,3 +5,2 @@ import { GraphQLSchema, parse, buildClientSchema, Source as GraphQLSource } from 'graphql';

import { debugLog, printSchemaWithDirectives, asArray, fixWindowsPath } from '@graphql-toolkit/common';
import { readFileSync } from 'fs';
function isSchemaText(obj) {

@@ -51,3 +50,3 @@ return typeof obj === 'string';

if (require && require.cache) {
filePath = require.resolve(filePath);
filePath = eval(`require.resolve('${filePath}')`);
if (require.cache[filePath]) {

@@ -57,3 +56,3 @@ delete require.cache[filePath];

}
const rawExports = await import(filePath);
const rawExports = await eval(`require('${filePath}');`);
if (rawExports) {

@@ -84,2 +83,3 @@ let rawExport = rawExports.default || rawExports.schema || rawExports;

async function tryToLoadFromCodeAst(filePath, options) {
const { readFileSync } = eval(`require('fs')`);
const content = readFileSync(filePath, 'utf-8');

@@ -86,0 +86,0 @@ const foundDoc = await extractDocumentStringFromCodeFile(new GraphQLSource(content, filePath), options || {});

{
"name": "@graphql-toolkit/code-file-loader",
"version": "0.6.8-alpha-23bbb51.1+23bbb51",
"version": "0.6.8-alpha-2cde5e8.4+2cde5e8",
"description": "A set of utils for faster development of GraphQL tools",

@@ -24,12 +24,11 @@ "repository": "git@github.com:dotansimha/graphql-toolkit.git",

"devDependencies": {
"@types/jest": "24.0.21",
"@types/jest": "24.0.22",
"graphql": "14.5.8",
"jest": "24.9.0",
"ts-jest": "24.1.0",
"typescript": "3.6.4"
"typescript": "3.7.2"
},
"dependencies": {
"@graphql-toolkit/common": "0.6.8-alpha-23bbb51.1+23bbb51",
"graphql-tag-pluck": "0.8.7",
"tslib": "1.10.0"
"@graphql-toolkit/common": "0.6.8-alpha-2cde5e8.4+2cde5e8",
"graphql-tag-pluck": "0.8.7"
},

@@ -39,3 +38,3 @@ "publishConfig": {

},
"gitHead": "23bbb512598c95e67ba4476ca410e7049655db02"
"gitHead": "2cde5e8f3f6632320d783b2bebf7b57e7274a778"
}

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

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