public class OperationMapper extends Object
Drives the work of mapping Java structures into their GraphQL representations.
While the task of mapping types is delegated to instances ofTypeMapper,
selection of mappers, construction and attachment of resolvers (modeled by DataFetchers
in graphql-java), and other universal tasks are encapsulated
in this class.| Constructor and Description |
|---|
OperationMapper(BuildContext buildContext) |
| Modifier and Type | Method and Description |
|---|---|
List<graphql.schema.GraphQLDirective> |
getDirectives() |
List<graphql.schema.GraphQLFieldDefinition> |
getMutations()
Fetches all the mapped GraphQL fields representing mutations, ready to be attached to the root mutation type.
|
List<graphql.schema.GraphQLFieldDefinition> |
getQueries()
Fetches all the mapped GraphQL fields representing top-level queries, ready to be attached to the root query type.
|
List<graphql.schema.GraphQLFieldDefinition> |
getSubscriptions() |
graphql.schema.GraphQLDirective |
toGraphQLDirective(Directive directive,
BuildContext buildContext) |
graphql.schema.GraphQLFieldDefinition |
toGraphQLField(Operation operation,
BuildContext buildContext)
Maps a single operation to a GraphQL output field (as queries in GraphQL are nothing but fields of the root operation type).
|
graphql.schema.GraphQLInputObjectField |
toGraphQLInputField(InputField inputField,
BuildContext buildContext)
Maps a single field/property to a GraphQL input field.
|
graphql.schema.GraphQLInputType |
toGraphQLInputType(AnnotatedType javaType,
BuildContext buildContext) |
graphql.schema.GraphQLInputType |
toGraphQLInputType(AnnotatedType javaType,
Set<Class<? extends TypeMapper>> mappersToSkip,
BuildContext buildContext)
Maps a Java type to a GraphQL input type.
|
graphql.schema.GraphQLOutputType |
toGraphQLType(AnnotatedType javaType,
BuildContext buildContext) |
graphql.schema.GraphQLOutputType |
toGraphQLType(AnnotatedType javaType,
Set<Class<? extends TypeMapper>> mappersToSkip,
BuildContext buildContext)
Maps a Java type to a GraphQL output type.
|
public OperationMapper(BuildContext buildContext)
buildContext - The shared context containing all the global information needed for mappingpublic graphql.schema.GraphQLFieldDefinition toGraphQLField(Operation operation, BuildContext buildContext)
operation - The operation to map to a GraphQL output fieldbuildContext - The shared context containing all the global information needed for mappingpublic graphql.schema.GraphQLOutputType toGraphQLType(AnnotatedType javaType, BuildContext buildContext)
public graphql.schema.GraphQLOutputType toGraphQLType(AnnotatedType javaType, Set<Class<? extends TypeMapper>> mappersToSkip, BuildContext buildContext)
TypeMappers.
See TypeMapper.toGraphQLType(AnnotatedType, OperationMapper, java.util.Set, BuildContext)
javaType - The Java type that is to be mapped to a GraphQL output typebuildContext - The shared context containing all the global information needed for mappingpublic graphql.schema.GraphQLInputObjectField toGraphQLInputField(InputField inputField, BuildContext buildContext)
inputField - The field/property to map to a GraphQL input fieldbuildContext - The shared context containing all the global information needed for mappingpublic graphql.schema.GraphQLInputType toGraphQLInputType(AnnotatedType javaType, BuildContext buildContext)
public graphql.schema.GraphQLInputType toGraphQLInputType(AnnotatedType javaType, Set<Class<? extends TypeMapper>> mappersToSkip, BuildContext buildContext)
TypeMappers.
See TypeMapper.toGraphQLInputType(AnnotatedType, OperationMapper, java.util.Set, BuildContext)
javaType - The Java type that is to be mapped to a GraphQL input typebuildContext - The shared context containing all the global information needed for mappingpublic graphql.schema.GraphQLDirective toGraphQLDirective(Directive directive, BuildContext buildContext)
public List<graphql.schema.GraphQLFieldDefinition> getQueries()
public List<graphql.schema.GraphQLFieldDefinition> getMutations()
public List<graphql.schema.GraphQLFieldDefinition> getSubscriptions()
public List<graphql.schema.GraphQLDirective> getDirectives()
Copyright © 2016–2018. All rights reserved.