@groovy.transform.CompileStatic class GraphQLMapping
DSL to provide GraphQL specific data for a GORM entity Usage:
static graphql = {
exclude 'foo'
add('bar', String)
description 'Business users'
//OR: For code completion
static graphql = GraphQLMapping.build {
...
}
Type | Name and description |
---|---|
java.util.Set<java.lang.String> |
excluded |
Operations |
operations |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
add(CustomGraphQLProperty property) Add a new property to be included in the schema. |
|
void |
add(java.lang.String name, java.lang.Class type, groovy.lang.Closure closure = null) Add a new property to be included in the schema. |
|
void |
add(java.lang.String name, java.util.List<java.lang.Class> type, groovy.lang.Closure closure = null) Add a new property to be included in the schema. |
|
void |
add(java.lang.String name, java.lang.String typeName, groovy.lang.Closure closure) Add a new property to be included in the schema. |
|
static GraphQLMapping |
build(groovy.lang.Closure closure) Builder to provide code completion |
|
void |
exclude(java.lang.String... properties) Exclude one or more properties from being included in the schema |
|
java.util.List<CustomGraphQLProperty> |
getAdditional() |
|
java.util.List<CustomOperation> |
getCustomMutationOperations() |
|
java.util.List<CustomOperation> |
getCustomQueryOperations() |
|
java.util.Map<java.lang.String, GraphQLPropertyMapping> |
getPropertyMappings() |
|
static LazyGraphQLMapping |
lazy(groovy.lang.Closure closure) Builder to provide code completion. |
|
java.lang.Object |
methodMissing(java.lang.String name, java.lang.Object args) Supplies configuration for an existing property |
|
void |
mutation(java.lang.String name, java.lang.String typeName, groovy.lang.Closure closure) Builds a custom mutation operation with a complex type to be built in the provided closure. |
|
void |
mutation(java.lang.String name, java.lang.Class type, groovy.lang.Closure closure) Builds a custom mutation operation. |
|
void |
mutation(java.lang.String name, java.util.List<java.lang.Class> type, groovy.lang.Closure closure) Builds a custom mutation operation. |
|
PaginatedType |
pagedResult(java.lang.Class type) Denotes the return type of an operation should be paginated |
|
GraphQLPropertyMapping |
property(java.lang.String name, groovy.lang.Closure closure) Supply metadata about an existing property |
|
GraphQLPropertyMapping |
property(java.lang.String name, java.util.Map namedArgs) Supply metadata about an existing property |
|
GraphQLPropertyMapping |
property(java.util.Map namedArgs, java.lang.String name) Supply metadata about an existing property |
|
GraphQLPropertyMapping |
property(java.lang.String name, GraphQLPropertyMapping mapping) Supply metadata about an existing property |
|
void |
query(java.lang.String name, java.lang.String typeName, groovy.lang.Closure closure) Builds a custom query operation with a complex type to be built in the provided closure. |
|
void |
query(java.lang.String name, java.util.List<java.lang.Class> type, groovy.lang.Closure closure) Builds a custom query operation. |
|
void |
query(java.lang.String name, java.lang.Class type, groovy.lang.Closure closure) Builds a custom query operation. |
|
void |
query(java.lang.String name, PaginatedType type, groovy.lang.Closure closure) Builds a custom query operation that returns a paginated result. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Add a new property to be included in the schema. The property may or may not be backed by an instance method depending on whether or not the property is to be used for response.
property
- The property to includeAdd a new property to be included in the schema. The property may or may not be backed by an instance method depending on whether or not the property is to be used as a part of a response.
name
- The name of property to includetype
- The returnType of property to includeclosure
- A closure to further configure the propertyAdd a new property to be included in the schema. The property may or may not be backed by an instance method depending on whether or not the property is to be used as a part of a response. The provided list must contain exactly 1 element that is a class.
name
- The name of property to includetype
- The returnType of property to includeclosure
- A closure to further configure the propertyAdd a new property to be included in the schema. The property may or may not be backed by an instance method depending on whether or not the property is to be used for response. Use this method to define a complex type for the property with the returns block.
name
- The name of property to includetypeName
- The name of the custom type being createdclosure
- A closure to further configure the propertyBuilder to provide code completion
closure
- The closure to execute in the context of a mappingExclude one or more properties from being included in the schema
properties
- One or more property namesBuilder to provide code completion. The mapping instance will not be evaluated until the schema is being generated
closure
- The closure to execute in the context of a mappingSupplies configuration for an existing property Usage: foo { description "Foo" } foo description: "Foo" //Provides code completion foo GraphQLPropertyMapping.build { description("Foo") }
Builds a custom mutation operation with a complex type to be built in the provided closure.
name
- The name used by clients of the GraphQL API to execute the operationtypeName
- The name of the custom type returned from the operationclosure
- The closure to build the operationBuilds a custom mutation operation.
name
- The name used by clients of the GraphQL API to execute the operationtype
- The return type. May be an enum, simple class, or domain class.closure
- The closure to build the operationBuilds a custom mutation operation. The provided list must ontain exactly 1 element that is a class. This method indicates the return type will be a list.
name
- The name used by clients of the GraphQL API to execute the operationtype
- The return type. A list with exactly 1 element that is a class. The
class may be an enum, simple type, or domain class.closure
- The closure to build the operationDenotes the return type of an operation should be paginated
type
- The domain class being returnedSupply metadata about an existing property
name
- The property nameclosure
- The closure to build the metadataSupply metadata about an existing property Example: property('foo', [input: false])
name
- The property namenamedArgs
- The arguments to build the mappingSupply metadata about an existing property Example: property('foo', input: false)
name
- The property namenamedArgs
- The arguments to build the mappingSupply metadata about an existing property
name
- The property namemapping
- The property mapping instanceBuilds a custom query operation with a complex type to be built in the provided closure.
name
- The name used by clients of the GraphQL API to execute the operationtypeName
- The name of the custom type returned from the operationclosure
- The closure to build the operationBuilds a custom query operation. The provided list must ontain exactly 1 element that is a class. This method indicates the return type will be a list.
name
- The name used by clients of the GraphQL API to execute the operationtype
- The return type. A list with exactly 1 element that is a class. The
class may be an enum, simple type, or domain class.closure
- The closure to build the operationBuilds a custom query operation.
name
- The name used by clients of the GraphQL API to execute the operationtype
- The return type. May be an enum, simple class, or domain class.closure
- The closure to build the operationBuilds a custom query operation that returns a paginated result.
name
- The name used by clients of the GraphQL API to execute the operationtype
- The return type. May be an enum, simple class, or domain class.closure
- The closure to build the operation