@@ -3,15 +3,15 @@ title: graphql/type
33layout : ../_core/GraphQLJSLayout
44category : API Reference
55permalink : /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
77next : /graphql-js/utilities/
88---
99
1010The ` 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:
1111
1212``` 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
1515```
1616
1717## Overview
@@ -20,8 +20,8 @@ _Schema_
2020
2121<ul class =" apiIndex " >
2222 <li >
23- <a href="#graphqlschema ">
24- <pre>class GraphQLSchema </pre>
23+ <a href="#graphqlschemaimpl ">
24+ <pre>class GraphQLSchemaImpl </pre>
2525 A representation of the capabilities of a GraphQL Server.
2626 </a>
2727 </li >
@@ -31,50 +31,50 @@ _Definitions_
3131
3232<ul class =" apiIndex " >
3333 <li >
34- <a href="#graphqlscalartype ">
35- <pre>class GraphQLScalarType </pre>
34+ <a href="#graphqlscalartypeimpl ">
35+ <pre>class GraphQLScalarTypeImpl </pre>
3636 A scalar type within GraphQL.
3737 </a>
3838 </li >
3939 <li >
40- <a href="#graphqlobjecttype ">
41- <pre>class GraphQLObjectType </pre>
40+ <a href="#graphqlobjecttypeimpl ">
41+ <pre>class GraphQLObjectTypeImpl </pre>
4242 An object type within GraphQL that contains fields.
4343 </a>
4444 </li >
4545 <li >
46- <a href="#graphqlinterfacetype ">
47- <pre>class GraphQLInterfaceType </pre>
46+ <a href="#graphqlinterfacetypeimpl ">
47+ <pre>class GraphQLInterfaceTypeImpl </pre>
4848 An interface type within GraphQL that defines fields implementations will contain.
4949 </a>
5050 </li >
5151 <li >
52- <a href="#graphqluniontype ">
53- <pre>class GraphQLUnionType </pre>
52+ <a href="#graphqluniontypeimpl ">
53+ <pre>class GraphQLUnionTypeImpl </pre>
5454 A union type within GraphQL that defines a list of implementations.
5555 </a>
5656 </li >
5757 <li >
58- <a href="#graphqlenumtype ">
59- <pre>class GraphQLEnumType </pre>
58+ <a href="#graphqlenumtypeimpl ">
59+ <pre>class GraphQLEnumTypeImpl </pre>
6060 An enum type within GraphQL that defines a list of valid values.
6161 </a>
6262 </li >
6363 <li >
64- <a href="#graphqlinputobjecttype ">
65- <pre>class GraphQLInputObjectType </pre>
64+ <a href="#graphqlinputobjecttypeimpl ">
65+ <pre>class GraphQLInputObjectTypeImpl </pre>
6666 An input object type within GraphQL that represents structured inputs.
6767 </a>
6868 </li >
6969 <li >
70- <a href="#graphqllist ">
71- <pre>class GraphQLList </pre>
70+ <a href="#graphqllistimpl ">
71+ <pre>class GraphQLListImpl </pre>
7272 A type wrapper around other types that represents a list of those types.
7373 </a>
7474 </li >
7575 <li >
76- <a href="#graphqlnonnull ">
77- <pre>class GraphQLNonNull </pre>
76+ <a href="#graphqlnonnullimpl ">
77+ <pre>class GraphQLNonNullImpl </pre>
7878 A type wrapper around other types that represents a non-null version of those types.
7979 </a>
8080 </li >
@@ -188,7 +188,7 @@ validator and executor.
188188#### Example
189189
190190` ` ` js
191- var MyAppSchema = new GraphQLSchema ({
191+ var MyAppSchema = new GraphQLSchemaImpl ({
192192 query: MyAppQueryRootType
193193 mutation: MyAppMutationRootType
194194});
@@ -220,7 +220,7 @@ functions used to ensure validity.
220220#### Example
221221
222222` ` ` js
223- var OddType = new GraphQLScalarType ({
223+ var OddType = new GraphQLScalarTypeImpl ({
224224 name: ' Odd' ,
225225 serialize: oddValue,
226226 parseValue: oddValue,
@@ -315,7 +315,7 @@ that value can always be referenced with `this`.
315315#### Examples
316316
317317` ` ` js
318- var AddressType = new GraphQLObjectType ({
318+ var AddressType = new GraphQLObjectTypeImpl ({
319319 name: ' Address' ,
320320 fields: {
321321 street: { type: GraphQLString },
@@ -329,7 +329,7 @@ var AddressType = new GraphQLObjectType({
329329 },
330330});
331331
332- var PersonType = new GraphQLObjectType ({
332+ var PersonType = new GraphQLObjectTypeImpl ({
333333 name: ' Person' ,
334334 fields : () => ({
335335 name: { type: GraphQLString },
@@ -361,7 +361,7 @@ when the field is resolved.
361361#### Example
362362
363363` ` ` js
364- var EntityType = new GraphQLInterfaceType ({
364+ var EntityType = new GraphQLInterfaceTypeImpl ({
365365 name: ' Entity' ,
366366 fields: {
367367 name: { type: GraphQLString },
@@ -393,7 +393,7 @@ to determine which type is actually used when the field is resolved.
393393### Example
394394
395395` ` ` js
396- var PetType = new GraphQLUnionType ({
396+ var PetType = new GraphQLUnionTypeImpl ({
397397 name: ' Pet' ,
398398 types: [DogType, CatType],
399399 resolveType (value ) {
@@ -448,7 +448,7 @@ will be used as its internal value.
448448#### Example
449449
450450` ` ` js
451- var RGBType = new GraphQLEnumType ({
451+ var RGBType = new GraphQLEnumTypeImpl ({
452452 name: ' RGB' ,
453453 values: {
454454 RED : { value: 0 },
@@ -503,11 +503,11 @@ Using `NonNull` will ensure that a value must be provided by the query
503503#### Example
504504
505505` ` ` js
506- var GeoPoint = new GraphQLInputObjectType ({
506+ var GeoPoint = new GraphQLInputObjectTypeImpl ({
507507 name: ' GeoPoint' ,
508508 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) },
511511 alt: { type: GraphQLFloat, defaultValue: 0 },
512512 },
513513});
@@ -528,11 +528,11 @@ an object type.
528528#### Example
529529
530530` ` ` js
531- var PersonType = new GraphQLObjectType ({
531+ var PersonType = new GraphQLObjectTypeImpl ({
532532 name: ' Person' ,
533533 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) },
536536 }),
537537});
538538` ` `
@@ -554,10 +554,10 @@ usually the id field of a database row will never be null.
554554#### Example
555555
556556` ` ` js
557- var RowType = new GraphQLObjectType ({
557+ var RowType = new GraphQLObjectTypeImpl ({
558558 name: ' Row' ,
559559 fields : () => ({
560- id: { type: new GraphQLNonNull (String ) },
560+ id: { type: new GraphQLNonNullImpl (String ) },
561561 }),
562562});
563563` ` `
0 commit comments