Package net.morimekta.providence.graphql
Class GQLDefinition
- java.lang.Object
-
- net.morimekta.providence.graphql.GQLDefinition
-
@Immutable public class GQLDefinition extends java.lang.ObjectA GQL service is a collection of zero or more 'queries' and zero or more 'mutations'. The query and mutation distinction is meant to represent reading and writing operations, but in reality they distinguish parallel and serial execution, in case the query contains more than one base entry.
-
-
Constructor Summary
Constructors Constructor Description GQLDefinition(net.morimekta.providence.descriptor.PService query, net.morimekta.providence.descriptor.PService mutation, java.util.Collection<net.morimekta.providence.descriptor.PField> idFields)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description net.morimekta.providence.graphql.introspection.SchemagetIntrospectionSchema()Return the introspection schema for this definition.net.morimekta.providence.graphql.introspection.TypegetIntrospectionType(java.lang.String name)Get the introspection type for a defined type.net.morimekta.providence.graphql.introspection.TypegetIntrospectionType(net.morimekta.providence.descriptor.PDescriptor descriptor, boolean isInput)Get introspection type for a given descriptor.net.morimekta.providence.descriptor.PServicegetMutation()Get mutation by name, e.g. for gql queries like this:net.morimekta.providence.descriptor.PServicegetQuery()Get query, e.g. for gql queries like this:java.lang.StringgetSchema()Get a defined schema from the GQL service.net.morimekta.providence.descriptor.PDescriptorgetType(java.lang.String name)Get a type used in the GQL service.
-
-
-
Method Detail
-
getQuery
@Nonnull public net.morimekta.providence.descriptor.PService getQuery()
Get query, e.g. for gql queries like this:{ hero(id:1001) { name } }- Returns:
- The query service.
-
getMutation
@Nullable public net.morimekta.providence.descriptor.PService getMutation()
Get mutation by name, e.g. for gql queries like this:mutation HeroStore { deleteHero(id:1001) { name } }- Returns:
- The mutation service.
-
getType
public net.morimekta.providence.descriptor.PDescriptor getType(@Nonnull java.lang.String name)Get a type used in the GQL service.- Parameters:
name- The name of the type.- Returns:
- The type description, enum or message.
-
getIntrospectionType
@Nullable public net.morimekta.providence.graphql.introspection.Type getIntrospectionType(@Nonnull java.lang.String name)Get the introspection type for a defined type.- Parameters:
name- The type name.- Returns:
- Introspection type, or null if not defined in service.
-
getIntrospectionType
@Nonnull public net.morimekta.providence.graphql.introspection.Type getIntrospectionType(@Nonnull net.morimekta.providence.descriptor.PDescriptor descriptor, boolean isInput)Get introspection type for a given descriptor.- Parameters:
descriptor- The descriptor to get introspection type for.isInput- If the type should be an input type.- Returns:
- The introspection type.
-
getSchema
public java.lang.String getSchema()
Get a defined schema from the GQL service.- Returns:
- The GQL schema.
-
getIntrospectionSchema
@Nonnull public net.morimekta.providence.graphql.introspection.Schema getIntrospectionSchema()
Return the introspection schema for this definition.- Returns:
- The schema.
-
-