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;