@@ -3,15 +3,15 @@ title: graphql/type
3
3
layout : ../_core/GraphQLJSLayout
4
4
category : API Reference
5
5
permalink : /graphql-js/type/
6
- sublinks : getNamedType,getNullableType,GraphQLBoolean,GraphQLEnumType ,GraphQLFloat,GraphQLID,GraphQLInputObjectType ,GraphQLInt,GraphQLInterfaceType,GraphQLList,GraphQLNonNull,GraphQLObjectType,GraphQLScalarType,GraphQLSchema ,GraphQLString,GraphQLUnionType ,isAbstractType,isCompositeType,isInputType,isLeafType,isOutputType
6
+ sublinks : getNamedType,getNullableType,GraphQLBoolean,GraphQLEnumTypeImpl ,GraphQLFloat,GraphQLID,GraphQLInputObjectTypeImpl ,GraphQLInt,GraphQLInterfaceTypeImpl,GraphQLListImpl,GraphQLNonNullImpl,GraphQLObjectTypeImpl,GraphQLScalarTypeImpl,GraphQLSchemaImpl ,GraphQLString,GraphQLUnionTypeImpl ,isAbstractType,isCompositeType,isInputType,isLeafType,isOutputType
7
7
next : /graphql-js/utilities/
8
8
---
9
9
10
10
The ` graphql/type ` module is responsible for defining GraphQL types and schema. You can import either from the ` graphql/type ` module, or from the root ` graphql ` module. For example:
11
11
12
12
``` js
13
- import { GraphQLSchema } from ' graphql' ; // ES6
14
- var { GraphQLSchema } = require (' graphql' ); // CommonJS
13
+ import { GraphQLSchemaImpl } from ' graphql' ; // ES6
14
+ var { GraphQLSchemaImpl } = require (' graphql' ); // CommonJS
15
15
```
16
16
17
17
## Overview
@@ -20,8 +20,8 @@ _Schema_
20
20
21
21
<ul class =" apiIndex " >
22
22
<li >
23
- <a href="#graphqlschema ">
24
- <pre>class GraphQLSchema </pre>
23
+ <a href="#graphqlschemaimpl ">
24
+ <pre>class GraphQLSchemaImpl </pre>
25
25
A representation of the capabilities of a GraphQL Server.
26
26
</a>
27
27
</li >
@@ -31,50 +31,50 @@ _Definitions_
31
31
32
32
<ul class =" apiIndex " >
33
33
<li >
34
- <a href="#graphqlscalartype ">
35
- <pre>class GraphQLScalarType </pre>
34
+ <a href="#graphqlscalartypeimpl ">
35
+ <pre>class GraphQLScalarTypeImpl </pre>
36
36
A scalar type within GraphQL.
37
37
</a>
38
38
</li >
39
39
<li >
40
- <a href="#graphqlobjecttype ">
41
- <pre>class GraphQLObjectType </pre>
40
+ <a href="#graphqlobjecttypeimpl ">
41
+ <pre>class GraphQLObjectTypeImpl </pre>
42
42
An object type within GraphQL that contains fields.
43
43
</a>
44
44
</li >
45
45
<li >
46
- <a href="#graphqlinterfacetype ">
47
- <pre>class GraphQLInterfaceType </pre>
46
+ <a href="#graphqlinterfacetypeimpl ">
47
+ <pre>class GraphQLInterfaceTypeImpl </pre>
48
48
An interface type within GraphQL that defines fields implementations will contain.
49
49
</a>
50
50
</li >
51
51
<li >
52
- <a href="#graphqluniontype ">
53
- <pre>class GraphQLUnionType </pre>
52
+ <a href="#graphqluniontypeimpl ">
53
+ <pre>class GraphQLUnionTypeImpl </pre>
54
54
A union type within GraphQL that defines a list of implementations.
55
55
</a>
56
56
</li >
57
57
<li >
58
- <a href="#graphqlenumtype ">
59
- <pre>class GraphQLEnumType </pre>
58
+ <a href="#graphqlenumtypeimpl ">
59
+ <pre>class GraphQLEnumTypeImpl </pre>
60
60
An enum type within GraphQL that defines a list of valid values.
61
61
</a>
62
62
</li >
63
63
<li >
64
- <a href="#graphqlinputobjecttype ">
65
- <pre>class GraphQLInputObjectType </pre>
64
+ <a href="#graphqlinputobjecttypeimpl ">
65
+ <pre>class GraphQLInputObjectTypeImpl </pre>
66
66
An input object type within GraphQL that represents structured inputs.
67
67
</a>
68
68
</li >
69
69
<li >
70
- <a href="#graphqllist ">
71
- <pre>class GraphQLList </pre>
70
+ <a href="#graphqllistimpl ">
71
+ <pre>class GraphQLListImpl </pre>
72
72
A type wrapper around other types that represents a list of those types.
73
73
</a>
74
74
</li >
75
75
<li >
76
- <a href="#graphqlnonnull ">
77
- <pre>class GraphQLNonNull </pre>
76
+ <a href="#graphqlnonnullimpl ">
77
+ <pre>class GraphQLNonNullImpl </pre>
78
78
A type wrapper around other types that represents a non-null version of those types.
79
79
</a>
80
80
</li >
@@ -188,7 +188,7 @@ validator and executor.
188
188
#### Example
189
189
190
190
` ` ` js
191
- var MyAppSchema = new GraphQLSchema ({
191
+ var MyAppSchema = new GraphQLSchemaImpl ({
192
192
query: MyAppQueryRootType
193
193
mutation: MyAppMutationRootType
194
194
});
@@ -220,7 +220,7 @@ functions used to ensure validity.
220
220
#### Example
221
221
222
222
` ` ` js
223
- var OddType = new GraphQLScalarType ({
223
+ var OddType = new GraphQLScalarTypeImpl ({
224
224
name: ' Odd' ,
225
225
serialize: oddValue,
226
226
parseValue: oddValue,
@@ -315,7 +315,7 @@ that value can always be referenced with `this`.
315
315
#### Examples
316
316
317
317
` ` ` js
318
- var AddressType = new GraphQLObjectType ({
318
+ var AddressType = new GraphQLObjectTypeImpl ({
319
319
name: ' Address' ,
320
320
fields: {
321
321
street: { type: GraphQLString },
@@ -329,7 +329,7 @@ var AddressType = new GraphQLObjectType({
329
329
},
330
330
});
331
331
332
- var PersonType = new GraphQLObjectType ({
332
+ var PersonType = new GraphQLObjectTypeImpl ({
333
333
name: ' Person' ,
334
334
fields : () => ({
335
335
name: { type: GraphQLString },
@@ -361,7 +361,7 @@ when the field is resolved.
361
361
#### Example
362
362
363
363
` ` ` js
364
- var EntityType = new GraphQLInterfaceType ({
364
+ var EntityType = new GraphQLInterfaceTypeImpl ({
365
365
name: ' Entity' ,
366
366
fields: {
367
367
name: { type: GraphQLString },
@@ -393,7 +393,7 @@ to determine which type is actually used when the field is resolved.
393
393
### Example
394
394
395
395
` ` ` js
396
- var PetType = new GraphQLUnionType ({
396
+ var PetType = new GraphQLUnionTypeImpl ({
397
397
name: ' Pet' ,
398
398
types: [DogType, CatType],
399
399
resolveType (value ) {
@@ -448,7 +448,7 @@ will be used as its internal value.
448
448
#### Example
449
449
450
450
` ` ` js
451
- var RGBType = new GraphQLEnumType ({
451
+ var RGBType = new GraphQLEnumTypeImpl ({
452
452
name: ' RGB' ,
453
453
values: {
454
454
RED : { value: 0 },
@@ -503,11 +503,11 @@ Using `NonNull` will ensure that a value must be provided by the query
503
503
#### Example
504
504
505
505
` ` ` js
506
- var GeoPoint = new GraphQLInputObjectType ({
506
+ var GeoPoint = new GraphQLInputObjectTypeImpl ({
507
507
name: ' GeoPoint' ,
508
508
fields: {
509
- lat: { type: new GraphQLNonNull (GraphQLFloat) },
510
- lon: { type: new GraphQLNonNull (GraphQLFloat) },
509
+ lat: { type: new GraphQLNonNullImpl (GraphQLFloat) },
510
+ lon: { type: new GraphQLNonNullImpl (GraphQLFloat) },
511
511
alt: { type: GraphQLFloat, defaultValue: 0 },
512
512
},
513
513
});
@@ -528,11 +528,11 @@ an object type.
528
528
#### Example
529
529
530
530
` ` ` js
531
- var PersonType = new GraphQLObjectType ({
531
+ var PersonType = new GraphQLObjectTypeImpl ({
532
532
name: ' Person' ,
533
533
fields : () => ({
534
- parents: { type: new GraphQLList (Person) },
535
- children: { type: new GraphQLList (Person) },
534
+ parents: { type: new GraphQLListImpl (Person) },
535
+ children: { type: new GraphQLListImpl (Person) },
536
536
}),
537
537
});
538
538
` ` `
@@ -554,10 +554,10 @@ usually the id field of a database row will never be null.
554
554
#### Example
555
555
556
556
` ` ` js
557
- var RowType = new GraphQLObjectType ({
557
+ var RowType = new GraphQLObjectTypeImpl ({
558
558
name: ' Row' ,
559
559
fields : () => ({
560
- id: { type: new GraphQLNonNull (String ) },
560
+ id: { type: new GraphQLNonNullImpl (String ) },
561
561
}),
562
562
});
563
563
` ` `
0 commit comments