public class GraphqlClient extends Object
| Modifier and Type | Method and Description |
|---|---|
static GraphqlClient |
buildGraphqlClient(String graphqlUrl)
构建一个Graphql客户端
|
<T extends GraphqlMutation> |
doMutation(T mutation)
执行操作
|
<T extends GraphqlMutation> |
doMutation(T mutation,
GraphqlRequestType graphqlRequestType)
执行操作
|
<T extends GraphqlQuery> |
doQuery(T query)
执行查询
|
<T extends GraphqlQuery> |
doQuery(T query,
GraphqlRequestType graphqlRequestType)
执行查询
|
void |
setHttpHeaders(Map<String,String> headers)
设置http的头
|
public static GraphqlClient buildGraphqlClient(String graphqlUrl)
graphqlUrl - graphql server urlpublic <T extends GraphqlQuery> GraphqlResponse doQuery(T query) throws IOException
T - queryquery - exec queryIOException - Exceptionpublic <T extends GraphqlQuery> GraphqlResponse doQuery(T query, GraphqlRequestType graphqlRequestType) throws IOException
T - 继承 queryquery - exec querygraphqlRequestType - request type get or post,but no get nowIOException - Exceptionpublic <T extends GraphqlMutation> GraphqlResponse doMutation(T mutation) throws IOException
T - Mutationmutation - exec mutationIOException - Exceptionpublic <T extends GraphqlMutation> GraphqlResponse doMutation(T mutation, GraphqlRequestType graphqlRequestType) throws IOException
T - Mutationmutation - exec mutationgraphqlRequestType - request type get or post,but no get nowIOException - ExceptionCopyright © 2019. All rights reserved.