Given a Type Name and a `$config` array, this adds an UnionType to the TypeRegistry Parameters $type_name (string): The unique name of the Type in the Schema. This must be unique amongst the entire Schema. $config (array): Configuration for the field $description (string): Description of the Union type. $types (array): An array of Types that …
Post Type Archives: Functions
register_graphql_field
Add a field to a Type in the GraphQL Schema Parameters $type_name (string): The name of the GraphQL Type in the Schema to register the field to $field_name (string): The name of the field. Should be unique to the Type the field is being registered to. $config (array): Configuration for the field $type (string | …
register_graphql_fields
Add one or more fields to a Type in the GraphQL Schema Parameters $fields (array): Associative array of key/value pairs where the key is the name of the field and the value is a config array for the field. $name (string): The name of the field to add to the Type. “camelCase” recommended. $config (array): …
register_graphql_object_type
Add an Object Type to the GraphQL Schema Parameters $type_name (string): The name of the Type. This must be unique across all Types of any kind in the GraphQL Schema. $config (array): $description (string): Description of the Object Type. What does it represent? This will be used in Introspection for for self-documenting the Type in …
register_graphql_input_type
Given a Type Name and a $config array, this adds an InputType to the TypeRegistry Parameters $type_name (string): The unique name of the InputType $config (array): Configuration for the input type $description (string): Description of the input type. This will be used to self-document the schema and should describe to clients how the input type …
register_graphql_enum_type
Given a Type Name and a $config array, this adds an EnumType to the TypeRegistry Parameters $type_name (string): The unique name of the EnumType $config (array): Configuration for the EnumType $description (string): Description of the enum type. This will be used to self-document the schema and should describe to clients how the enum type should …
register_graphql_interface_type
Given a Type Name and a $config array, this adds an Interface Type to the TypeRegistry Parameters $type_name (string): The unique name of the Interface Type $config (array): Configuration for the field $description (string): Description of the interface type. $fields (array): The fields that are part of the interface type. $type (string): The field type …
register_graphql_interfaces_to_types
Given a type name and interface name, this applies the interface to the Type. Parameters $interface_names (array): An array of interface names to register the types to $type_names (array): An array of type names to register the interfaces to Source File: access-functions.php Examples First an interface needs to be registered. This example adds an Interface …
register_graphql_connection
Given a config array for a connection, this registers a connection by creating all appropriate fields and types for the connection. Parameters $config (array): Configuration for the connection $fromType (string): The name of the Type the connection is coming from $toType (string): The name of the type the connection is going to $fromFieldName (string): The …
register_graphql_scalar
Given a config array for a custom Scalar, this registers a Scalar for use in the Schema Per the GraphQL Spec, WPGraphQL provides several built-in scalar types. Boolean Float Integer ID String This function is used to define new Scalars to the Schema. Some common cases are Url, Email, Date, and others. Note: Future versions …