How to use the GraphQLEnumType function from graphql

Find comprehensive JavaScript graphql.GraphQLEnumType code examples handpicked from public code repositorys.

4
5
6
7
8
9
10
11
12
13
14
const {
  sqlTypeToGraphQL,
  fromSelectionSet
} = require('./utils')


const ascDesc = new graphql.GraphQLEnumType({
  name: 'OrderByDirection',
  values: {
    ASC: { value: 'ASC' },
    DESC: { value: 'DESC' }
fork icon85
star icon888
watch icon16

+ 98 other calls in file

5
6
7
8
9
10
11
12
13
14
const InterfaceType = graphql.GraphQLInterfaceType;
const ScalarType = graphql.GraphQLScalarType;
const ObjectType = graphql.GraphQLObjectType;
const UnionType = graphql.GraphQLUnionType;
const NonNullType = graphql.GraphQLNonNull;
const EnumType = graphql.GraphQLEnumType;
const ListType = graphql.GraphQLList;

const builtInScalars = {
  'String': graphql.GraphQLString,
fork icon13
star icon203
watch icon10

+ 3 other calls in file

8
9
10
11
12
13
14
15
16
17
18
  DEFAULT_OPTIONS,
  OPTION_DEPRECATED,
} = require("../../../src/const/options");


describe("enum", () => {
  const type = new GraphQLEnumType({
    name: "EnumTypeName",
    values: {
      one: { value: "one" },
      two: { value: "two", deprecationReason: "Deprecated" },
fork icon25
star icon107
watch icon0

68
69
70
71
72
73
74
75
76
77
}
function isObjectType(type) {
  return type instanceof gql.GraphQLObjectType;
}
function isEnumType(type) {
  return type instanceof gql.GraphQLEnumType;
}
function isInputObjectType(type) {
  return type instanceof gql.GraphQLInputObjectType;
}
fork icon7
star icon43
watch icon3

+ 9 other calls in file

1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
        access_token: graphql_1.GraphQLString,
        expires: graphql_1.GraphQLInt,
        refresh_token: graphql_1.GraphQLString,
    },
});
const AuthMode = new graphql_1.GraphQLEnumType({
    name: 'auth_mode',
    values: {
        json: { value: 'json' },
        cookie: { value: 'cookie' },
fork icon0
star icon0
watch icon1

+ 85 other calls in file

106
107
108
109
110
111
112
113
114
115
type: ProjectType,
args: {
    name: { type: GraphQLNonNull(GraphQLString) },
    description: { type: GraphQLNonNull(GraphQLString) },
    status: {
        type: new GraphQLEnumType({
            name: 'ProjectStatus',
            values: {
                'new': { value: 'Not started' },
                'progress': { value: 'In progress' },
fork icon0
star icon0
watch icon0

5
6
7
8
9
10
11
12
13
14
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;
global.GraphqlBoolean = global.GraphQLBoolean = graphql.GraphQLBoolean;
fork icon0
star icon0
watch icon5