Class TypeFieldProvider
- java.lang.Object
-
- net.morimekta.providence.graphql.utils.TypeFieldProvider
-
- All Implemented Interfaces:
GQLFieldProvider<net.morimekta.providence.graphql.introspection.Type>
public class TypeFieldProvider extends java.lang.Object implements GQLFieldProvider<net.morimekta.providence.graphql.introspection.Type>
-
-
Constructor Summary
Constructors Constructor Description TypeFieldProvider(GQLDefinition definition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description net.morimekta.providence.descriptor.PMessageDescriptor<net.morimekta.providence.graphql.introspection.Type>getDescriptor()Get the type descriptor this mutator is for.java.util.Collection<net.morimekta.providence.descriptor.PField<net.morimekta.providence.graphql.introspection.Type>>getFields()Get the set of fields that can be mutated with this mutator.java.util.List<net.morimekta.providence.graphql.introspection.Type>provide(net.morimekta.providence.graphql.introspection.Type message, net.morimekta.providence.descriptor.PField<net.morimekta.providence.graphql.introspection.Type> field, GQLField selection)Mutate the message according to the field selection.
-
-
-
Constructor Detail
-
TypeFieldProvider
public TypeFieldProvider(@Nonnull GQLDefinition definition)
-
-
Method Detail
-
getDescriptor
public net.morimekta.providence.descriptor.PMessageDescriptor<net.morimekta.providence.graphql.introspection.Type> getDescriptor()
Description copied from interface:GQLFieldProviderGet the type descriptor this mutator is for. This may be an interface type. Only used for error messages. This type must be indicative of the fields accepted by the provider.- Specified by:
getDescriptorin interfaceGQLFieldProvider<net.morimekta.providence.graphql.introspection.Type>- Returns:
- The message type being mutated.
-
getFields
@Nonnull public java.util.Collection<net.morimekta.providence.descriptor.PField<net.morimekta.providence.graphql.introspection.Type>> getFields()
Description copied from interface:GQLFieldProviderGet the set of fields that can be mutated with this mutator.- Specified by:
getFieldsin interfaceGQLFieldProvider<net.morimekta.providence.graphql.introspection.Type>- Returns:
- Collection of mutating fields.
-
provide
public java.util.List<net.morimekta.providence.graphql.introspection.Type> provide(@Nonnull net.morimekta.providence.graphql.introspection.Type message, @Nonnull net.morimekta.providence.descriptor.PField<net.morimekta.providence.graphql.introspection.Type> field, @Nonnull GQLField selection)Description copied from interface:GQLFieldProviderMutate the message according to the field selection. The field selection will represent a single field in the base message, and will be called for each requested field.- Specified by:
providein interfaceGQLFieldProvider<net.morimekta.providence.graphql.introspection.Type>- Parameters:
message- The base message builder to be mutated.field- The source field requested.selection- The field selection to be filled or changed.- Returns:
- The mutated value for the field.
-
-