Add GraphQLJSONObject type to graphql-type-json definition (#35190)

* update graphql-type-json definitions

* update tests
This commit is contained in:
Brendan M 2019-05-13 09:49:13 -07:00 committed by Nathan Shively-Sanders
parent 498c398948
commit e18af54e46
2 changed files with 17 additions and 9 deletions

View File

@ -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
}
}
});

View File

@ -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 <https://github.com/schfkt>
// 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;