@graphql-tools/json-file-loader
Advanced tools
Comparing version
@@ -5,3 +5,3 @@ 'use strict'; | ||
const common = require('@graphql-tools/common'); | ||
const utils = require('@graphql-tools/utils'); | ||
@@ -17,3 +17,3 @@ const FILE_EXTENSIONS = ['.json']; | ||
canLoadSync(pointer, options) { | ||
if (common.isValidPath(pointer) && options.path && options.fs) { | ||
if (utils.isValidPath(pointer) && options.path && options.fs) { | ||
const { resolve, isAbsolute } = options.path; | ||
@@ -39,3 +39,3 @@ if (FILE_EXTENSIONS.find(extension => pointer.endsWith(extension))) { | ||
const jsonContent = readFileSync(normalizedFilepath, 'utf8'); | ||
return common.parseGraphQLJSON(pointer, jsonContent, options); | ||
return utils.parseGraphQLJSON(pointer, jsonContent, options); | ||
} | ||
@@ -42,0 +42,0 @@ catch (e) { |
@@ -1,2 +0,2 @@ | ||
import { Source, SchemaPointerSingle, DocumentLoader, SingleFileOptions } from '@graphql-tools/common'; | ||
import { Source, SchemaPointerSingle, DocumentLoader, SingleFileOptions } from '@graphql-tools/utils'; | ||
export interface JsonFileLoaderOptions extends SingleFileOptions { | ||
@@ -3,0 +3,0 @@ fs?: typeof import('fs'); |
@@ -1,2 +0,2 @@ | ||
import { isValidPath, parseGraphQLJSON } from '@graphql-tools/common'; | ||
import { isValidPath, parseGraphQLJSON } from '@graphql-tools/utils'; | ||
@@ -3,0 +3,0 @@ const FILE_EXTENSIONS = ['.json']; |
{ | ||
"name": "@graphql-tools/json-file-loader", | ||
"version": "5.0.1-alpha-78275ec.0", | ||
"version": "5.0.1-alpha-8b79332.0", | ||
"description": "A set of utils for faster development of GraphQL tools", | ||
@@ -9,3 +9,3 @@ "peerDependencies": { | ||
"dependencies": { | ||
"@graphql-tools/common": "5.0.1-alpha-78275ec.0", | ||
"@graphql-tools/utils": "5.0.1-alpha-8b79332.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
11284
-0.08%+ Added
+ Added
- Removed
- Removed