Class HumanController
java.lang.Object
org.junittest.allgraphqlcases_server_springconfiguration_util_batchmapping_map.util.HumanController
- Author:
- generated by graphql-java-generator
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataFetchersDelegateHuman
protected com.graphql_java_generator.server.util.GraphqlServerUtils
-
Constructor Summary
ConstructorsConstructorDescriptionHumanController
(org.springframework.graphql.execution.BatchLoaderRegistry registry) -
Method Summary
Modifier and TypeMethodDescriptionappearsIn
(org.dataloader.BatchLoaderEnvironment batchLoaderEnvironment, graphql.GraphQLContext graphQLContext, List<Human> keys) This methods loads the data for ${dataFetcher.graphQLType}.appearsIn.bestFriend
(org.dataloader.BatchLoaderEnvironment batchLoaderEnvironment, graphql.GraphQLContext graphQLContext, List<Human> keys) This methods loads the data for ${dataFetcher.graphQLType}.bestFriend.comments
(org.dataloader.BatchLoaderEnvironment batchLoaderEnvironment, graphql.GraphQLContext graphQLContext, List<Human> keys) This methods loads the data for ${dataFetcher.graphQLType}.comments.friends
(org.dataloader.BatchLoaderEnvironment batchLoaderEnvironment, graphql.GraphQLContext graphQLContext, List<Human> keys) This methods loads the data for ${dataFetcher.graphQLType}.friends.name
(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment, Human origin, Boolean uppercase) This method loads the data for ${dataFetcher.graphQLType}.name.
-
Field Details
-
dataFetchersDelegateHuman
-
graphqlServerUtils
@Autowired protected com.graphql_java_generator.server.util.GraphqlServerUtils graphqlServerUtils
-
-
Constructor Details
-
HumanController
public HumanController(org.springframework.graphql.execution.BatchLoaderRegistry registry)
-
-
Method Details
-
name
@SchemaMapping(field="name") public Object name(graphql.schema.DataFetchingEnvironment dataFetchingEnvironment, Human origin, @Argument("uppercase") Boolean uppercase) This method loads the data for ${dataFetcher.graphQLType}.name. It returns an Object: the data fetcher implementation may return any type that is accepted by a spring-graphql controller- Parameters:
dataFetchingEnvironment
- The GraphQLDataFetchingEnvironment
. It gives you access to the full GraphQL context for this DataFetcherorigin
- The object from which the field is fetch. In other word: the aim of this data fetcher is to fetch the author attribute of the origin, which is an instance of {ObjectType {name:Post, fields:{Field{name:id, type:ID!, params:[]},Field{name:date, type:Date!, params:[]},Field{name:author, type:Member, params:[]},Field{name:publiclyAvailable, type:Boolean, params:[]},Field{name:title, type:String!, params:[]},Field{name:content, type:String!, params:[]},Field{name:authorId, type:ID, params:[]},Field{name:topicId, type:ID, params:[]}}, comments ""}. It depends on your data modle, but it typically contains the id to use in the query.uppercase
- The parameter that will receive the field argument of the same name for the current data to fetch- Returns:
- It may return any value that is valid for a spring-graphql controller, annotated by
the
@SchemaMapping
annotation - Throws:
NoSuchElementException
- This method may return aNoSuchElementException
exception. In this case, the exception is trapped by the calling method, and the return is consider as null. This allows to use theOptional.get()
method directly, without caring of whether or not there is a value. The generated code will take care of theNoSuchElementException
exception.
-
bestFriend
@BatchMapping(field="bestFriend") public Map<Human,Character> bestFriend(org.dataloader.BatchLoaderEnvironment batchLoaderEnvironment, graphql.GraphQLContext graphQLContext, List<Human> keys) This methods loads the data for ${dataFetcher.graphQLType}.bestFriend. It is generated as thegenerateBatchMappingDataFetchers
plugin parameter is true.- Parameters:
batchLoaderEnvironment
- The environement for this batch loaded. You can extract the GraphQLContext from this parameter.graphQLContext
-keys
- The objects for which the value for the bestFriend field must be retrieved.- Returns:
- This method returns
${dataFetcher.batchMappingReturnType.value}
, as defined by thebatchMappingDataFetcherReturnType
plugin parameter.
Please look at the spring-graphql annotation for a documentation on how to return the proper values
-
friends
@BatchMapping(field="friends") public Map<Human,Character> friends(org.dataloader.BatchLoaderEnvironment batchLoaderEnvironment, graphql.GraphQLContext graphQLContext, List<Human> keys) This methods loads the data for ${dataFetcher.graphQLType}.friends. It is generated as thegenerateBatchMappingDataFetchers
plugin parameter is true.- Parameters:
batchLoaderEnvironment
- The environement for this batch loaded. You can extract the GraphQLContext from this parameter.graphQLContext
-keys
- The objects for which the value for the friends field must be retrieved.- Returns:
- This method returns
${dataFetcher.batchMappingReturnType.value}
, as defined by thebatchMappingDataFetcherReturnType
plugin parameter.
Please look at the spring-graphql annotation for a documentation on how to return the proper values
-
comments
@BatchMapping(field="comments") public Map<Human,String> comments(org.dataloader.BatchLoaderEnvironment batchLoaderEnvironment, graphql.GraphQLContext graphQLContext, List<Human> keys) This methods loads the data for ${dataFetcher.graphQLType}.comments. It is generated as thegenerateBatchMappingDataFetchers
plugin parameter is true.- Parameters:
batchLoaderEnvironment
- The environement for this batch loaded. You can extract the GraphQLContext from this parameter.graphQLContext
-keys
- The objects for which the value for the comments field must be retrieved.- Returns:
- This method returns
${dataFetcher.batchMappingReturnType.value}
, as defined by thebatchMappingDataFetcherReturnType
plugin parameter.
Please look at the spring-graphql annotation for a documentation on how to return the proper values
-
appearsIn
@BatchMapping(field="appearsIn") public Map<Human,Episode> appearsIn(org.dataloader.BatchLoaderEnvironment batchLoaderEnvironment, graphql.GraphQLContext graphQLContext, List<Human> keys) This methods loads the data for ${dataFetcher.graphQLType}.appearsIn. It is generated as thegenerateBatchMappingDataFetchers
plugin parameter is true.- Parameters:
batchLoaderEnvironment
- The environement for this batch loaded. You can extract the GraphQLContext from this parameter.graphQLContext
-keys
- The objects for which the value for the appearsIn field must be retrieved.- Returns:
- This method returns
${dataFetcher.batchMappingReturnType.value}
, as defined by thebatchMappingDataFetcherReturnType
plugin parameter.
Please look at the spring-graphql annotation for a documentation on how to return the proper values
-