How to use the GraphQLInterfaceType function from graphql
Find comprehensive JavaScript graphql.GraphQLInterfaceType code examples handpicked from public code repositorys.
0 1 2 3 4 5 6 7 8 9
const graphql = require('graphql'); const assert = require('assert'); const _ = require('lodash'); const InputObjectType = graphql.GraphQLInputObjectType; const InterfaceType = graphql.GraphQLInterfaceType; const ScalarType = graphql.GraphQLScalarType; const ObjectType = graphql.GraphQLObjectType; const UnionType = graphql.GraphQLUnionType; const NonNullType = graphql.GraphQLNonNull;
13
203
10
+ 3 other calls in file
3 4 5 6 7 8 9 10 11 12
const getGraphqlName = require('./getGraphqlName'); const getGraphqlTypeResolver = require('./getGraphqlTypeResolver'); function getGraphqlInterfaceType(g, iri) { return new GraphQLInterfaceType({ name: `${getGraphqlName(g, iri)}Interface`, description: `Interface for ${iri}`, fields: () => require('./getGraphqlFieldConfigMap')(g, iri), // dynamic require to prevent require cycles resolveType: getGraphqlTypeResolver(g, iri),
12
73
8
GitHub: larsbs/graysql
25 26 27 28 29 30 31 32 33 34
fields: () => this._parseFields(this._rawInterface.fields, types) }); for (const listener of this._listeners.onGenerateInterface) { ifaceDef = Object.assign(ifaceDef, listener({ iface: ifaceDef, types })); } return new graphql.GraphQLInterfaceType(ifaceDef); } _parseFields(fields, types) { const finalFields = {};
6
36
5
0 1 2 3 4 5 6 7 8 9
const graphql = require('graphql'); const TitleType = require('./title'); // Article, Media, etc const BlockItem = new graphql.GraphQLInterfaceType({ id: { type: new graphql.GraphQLString() }, type: {
2
0
27
4 5 6 7 8 9 10 11 12 13
global.GraphqlSchema = global.GraphQLSchema = graphql.GraphQLSchema; global.GraphqlObjectType = global.GraphQLObjectType = graphql.GraphQLObjectType; global.GraphqlList = global.GraphQLList = graphql.GraphQLList; global.GraphqlNonNull = global.GraphQLNonNull = graphql.GraphQLNonNull; global.GraphqlUnionType = global.GraphQLUnionType = graphql.GraphQLUnionType; global.GraphqlInterfaceType = global.GraphQLInterfaceType = graphql.GraphQLInterfaceType; global.GraphqlEnumType = global.GraphQLEnumType = graphql.GraphQLEnumType; global.GraphqlInt = global.GraphQLInt = graphql.GraphQLInt; global.GraphqlFloat = global.GraphQLFloat = graphql.GraphQLFloat; global.GraphqlString = global.GraphQLString = graphql.GraphQLString;
0
0
5
graphql.GraphQLNonNull is the most popular function in graphql (4226 examples)