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.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.
|
graphql.schema.GraphQLInputObjectField |
toGraphQLInputField(InputField inputField,
Set<Type> abstractTypes,
BuildContext buildContext)
Maps a single field/property to a GraphQL input field.
|
graphql.schema.GraphQLInputType |
toGraphQLInputType(AnnotatedType javaType,
Set<Type> abstractTypes,
BuildContext buildContext)
Maps a Java type to a GraphQL input type.
|
graphql.schema.GraphQLFieldDefinition |
toGraphQLOperation(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.GraphQLOutputType |
toGraphQLType(AnnotatedType javaType,
Set<Type> abstractTypes,
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 toGraphQLOperation(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, Set<Type> abstractTypes, BuildContext buildContext)
TypeMappers.
See TypeMapper.toGraphQLType(AnnotatedType, Set, OperationMapper, 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, Set<Type> abstractTypes, 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, Set<Type> abstractTypes, BuildContext buildContext)
TypeMappers.
See TypeMapper.toGraphQLInputType(AnnotatedType, Set, OperationMapper, 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 List<graphql.schema.GraphQLFieldDefinition> getQueries()
public List<graphql.schema.GraphQLFieldDefinition> getMutations()
Copyright © 2016–2017. All rights reserved.