From e18af54e464c69eb19d4fe74a20cdd71c35cf700 Mon Sep 17 00:00:00 2001 From: Brendan M Date: Mon, 13 May 2019 09:49:13 -0700 Subject: [PATCH] Add GraphQLJSONObject type to graphql-type-json definition (#35190) * update graphql-type-json definitions * update tests --- .../graphql-type-json-tests.ts | 18 ++++++++++++------ types/graphql-type-json/index.d.ts | 8 +++++--- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/types/graphql-type-json/graphql-type-json-tests.ts b/types/graphql-type-json/graphql-type-json-tests.ts index 8d2435270e..068e85f53e 100644 --- a/types/graphql-type-json/graphql-type-json-tests.ts +++ b/types/graphql-type-json/graphql-type-json-tests.ts @@ -1,20 +1,26 @@ import { GraphQLObjectType, GraphQLInputObjectType } from "graphql"; -import * as GraphQLJSON from "graphql-type-json"; +import GraphQLJSON, { GraphQLJSONObject } from "graphql-type-json"; const TestType = new GraphQLObjectType({ name: "TestType", fields: { - test: { + testValue: { type: GraphQLJSON - } + }, + testObject: { + type: GraphQLJSONObject + } } }); const TestInputType = new GraphQLInputObjectType({ name: "TestInputType", fields: { - test: { - type: GraphQLJSON - } + testValue: { + type: GraphQLJSON + }, + testObject: { + type: GraphQLJSONObject } + } }); diff --git a/types/graphql-type-json/index.d.ts b/types/graphql-type-json/index.d.ts index a6a8ec87ee..466472352a 100644 --- a/types/graphql-type-json/index.d.ts +++ b/types/graphql-type-json/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for graphql-type-json 0.1 +// Type definitions for graphql-type-json 0.3 // Project: https://github.com/taion/graphql-type-json#readme // Definitions by: Pavel Ivanov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,5 +6,7 @@ import { GraphQLScalarType } from "graphql"; -declare const GraphQLJSON: GraphQLScalarType; -export = GraphQLJSON; +export const GraphQLJSONObject: GraphQLScalarType; + +export const GraphQLJSON: GraphQLScalarType; +export default GraphQLJSON;