Class PartialPreparedRequests
java.lang.Object
com.graphql_java_generator.samples.forum.client.graphql.PartialPreparedRequests
- All Implemented Interfaces:
Queries
This class implements the away to call GraphQl queries, where all queries are prepared before execution.
The advantages are:
The advantages are:
- Performance: this avoid to build an
ObjectResponse
for each response. ThisObjectResponse
is useful, to help control at runtime if a field has been queried or not. It allows to throw an exception when your code tries to use a field that was not queried - Security: as all request have been prepared at startup, this make sure at startup that your queries are valid.
- Author:
- etienne-sf
-
Field Summary
Fields inherited from interface com.graphql_java_generator.samples.forum.client.Queries
DATE_FORMAT, dateFormat
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateBoard
(String name, boolean publiclyAvailable) createMember
(MemberInput input) createPost
(PostInput input) createPosts
(List<PostInput> input) createTopic
(TopicInput input) findTopics
(String boardName, List<String> keyword) void
init()
topicAuthorPostAuthor
(String boardName, Date since) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.graphql_java_generator.samples.forum.client.Queries
getPostInput, getTopicInput, getTopicPostInput
-
Constructor Details
-
PartialPreparedRequests
public PartialPreparedRequests()
-
-
Method Details
-
init
-
boardsSimple
- Specified by:
boardsSimple
in interfaceQueries
- Throws:
GraphQLRequestExecutionException
-
boardsAndTopicsWithFieldParameter
public List<Board> boardsAndTopicsWithFieldParameter(Date since) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException - Specified by:
boardsAndTopicsWithFieldParameter
in interfaceQueries
- Throws:
GraphQLRequestExecutionException
GraphQLRequestPreparationException
-
topicAuthorPostAuthor
public List<Topic> topicAuthorPostAuthor(String boardName, Date since) throws GraphQLRequestExecutionException - Specified by:
topicAuthorPostAuthor
in interfaceQueries
- Throws:
GraphQLRequestExecutionException
-
findTopics
public List<Topic> findTopics(String boardName, List<String> keyword) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException - Specified by:
findTopics
in interfaceQueries
- Throws:
GraphQLRequestExecutionException
GraphQLRequestPreparationException
-
createBoard
public Board createBoard(String name, boolean publiclyAvailable) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException - Specified by:
createBoard
in interfaceQueries
- Throws:
GraphQLRequestExecutionException
GraphQLRequestPreparationException
-
createTopic
public Topic createTopic(TopicInput input) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException - Specified by:
createTopic
in interfaceQueries
- Throws:
GraphQLRequestExecutionException
GraphQLRequestPreparationException
-
createMember
public Member createMember(MemberInput input) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException - Specified by:
createMember
in interfaceQueries
- Throws:
GraphQLRequestExecutionException
GraphQLRequestPreparationException
-
createPost
public Post createPost(PostInput input) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException - Specified by:
createPost
in interfaceQueries
- Throws:
GraphQLRequestExecutionException
GraphQLRequestPreparationException
-
createPosts
public List<Post> createPosts(List<PostInput> input) throws GraphQLRequestExecutionException, GraphQLRequestPreparationException - Specified by:
createPosts
in interfaceQueries
- Throws:
GraphQLRequestExecutionException
GraphQLRequestPreparationException
-