GraphQLObjectType <TSource, TContext>
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Type parameters
- TSource = any
- TContext = any
Parameters
config: Readonly<GraphQLObjectTypeConfig<TSource, TContext>>
Returns GraphQLObjectType<TSource, TContext>
Properties
astNode
description
extensionASTNodes
extensions
isTypeOf
name
Accessors
[toStringTag]
Returns string
Methods
getFields
Returns GraphQLFieldMap<TSource, TContext>
getInterfaces
Returns readonly GraphQLInterfaceType<any, any>[]
toConfig
Returns GraphQLObjectTypeNormalizedConfig<TSource, TContext>
toJSON
Returns string
toString
Returns string
Object Type Definition
Almost all of the GraphQL types you define will be object types. Object types have a name, but most importantly describe their fields.
Example:
When two types need to refer to each other, or a type needs to refer to itself in a field, you can use a function expression (aka a closure or a thunk) to supply the fields lazily.
Example: