Package net.morimekta.providence.graphql
Class GQLDefinition.Builder
- java.lang.Object
-
- net.morimekta.providence.graphql.GQLDefinition.Builder
-
- Enclosing class:
- GQLDefinition
public static class GQLDefinition.Builder extends java.lang.ObjectBuilder for setting up a GraphQL definition.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GQLDefinition.BuilderasInterface(net.morimekta.providence.descriptor.PUnionDescriptor<?>... descriptors)Handle these unions as interfaces.GQLDefinitionbuild()Build the GraphQL definition.GQLDefinition.BuilderidField(net.morimekta.providence.descriptor.PField<?>... fields)Transform field from string, binary or container of string or binary to ID or ID list.GQLDefinition.BuilderignoreFields(net.morimekta.providence.descriptor.PField<?>... fields)Skip these fields.GQLDefinition.BuilderignoreMaps()Just ignore all maps, instead of failing.GQLDefinition.BuilderignoreTypes(net.morimekta.providence.descriptor.PDeclaredDescriptor<?>... types)Setting this will ignore all fields of the given type, or containing the given type (list, set, map).GQLDefinition.Buildermutation(net.morimekta.providence.descriptor.PService mutation)Service used for handling queries.GQLDefinition.Builderquery(net.morimekta.providence.descriptor.PService query)Service used for handling queries.
-
-
-
Method Detail
-
query
public GQLDefinition.Builder query(net.morimekta.providence.descriptor.PService query)
Service used for handling queries.- Parameters:
query- The query service.- Returns:
- The builder.
-
mutation
public GQLDefinition.Builder mutation(net.morimekta.providence.descriptor.PService mutation)
Service used for handling queries.- Parameters:
mutation- The mutation service.- Returns:
- The builder.
-
idField
public GQLDefinition.Builder idField(net.morimekta.providence.descriptor.PField<?>... fields)
Transform field from string, binary or container of string or binary to ID or ID list.- Parameters:
fields- The fields to be made into ID fields.- Returns:
- The builder.
-
asInterface
public GQLDefinition.Builder asInterface(net.morimekta.providence.descriptor.PUnionDescriptor<?>... descriptors)
Handle these unions as interfaces. The union will be ignored in the schema (except for input types), and it's interface will be used instead.- Parameters:
descriptors- Union descriptors to handle as interfaces.- Returns:
- The builder.
-
ignoreMaps
public GQLDefinition.Builder ignoreMaps()
Just ignore all maps, instead of failing.- Returns:
- The builder.
-
ignoreFields
public GQLDefinition.Builder ignoreFields(net.morimekta.providence.descriptor.PField<?>... fields)
Skip these fields. It will be possible to select / reference the field, but it will be skipped from the schema.- Parameters:
fields- The fields to be ignore / skipped.- Returns:
- The builder.
-
ignoreTypes
public GQLDefinition.Builder ignoreTypes(net.morimekta.providence.descriptor.PDeclaredDescriptor<?>... types)
Setting this will ignore all fields of the given type, or containing the given type (list, set, map). Only declared types can be ignored.- Parameters:
types- Types to be ignored.- Returns:
- The builder.
-
build
public GQLDefinition build()
Build the GraphQL definition.- Returns:
- The GQL definition.
-
-