Class GraphQLRequestParamUtils
-
- All Implemented Interfaces:
public final class GraphQLRequestParamUtils
Utilities to (de)serialize GraphQL request parameters.
-
-
Field Summary
Fields Modifier and Type Field Description public final static String
VARIABLES_FIELD
public final static String
OPERATION_NAME_FIELD
public final static String
QUERY_FIELD
-
Method Summary
Modifier and Type Method Description static boolean
isGraphQLContentType(String contentType)
Return true if the content type is GraphQL content type (i.e. static String
toPostBodyString(GraphQLRequestParams params)
Convert the GraphQL request parameters input data to an HTTP POST body string. static String
queryToGetParamValue(String query)
Convert the GraphQL Query input string into an HTTP GET request parameter value. static String
variablesToGetParamValue(String variables)
Convert the GraphQL Variables JSON input string into an HTTP GET request parameter value. static GraphQLRequestParams
toGraphQLRequestParams(Array<byte> postData, String contentEncoding)
Parse postData
and convert it to a GraphQLRequestParams object if it is a valid GraphQL post data.static GraphQLRequestParams
toGraphQLRequestParams(Arguments arguments, String contentEncoding)
Parse arguments
and convert it to a GraphQLRequestParams object if it has valid GraphQL HTTP arguments.-
-
Method Detail
-
isGraphQLContentType
static boolean isGraphQLContentType(String contentType)
Return true if the content type is GraphQL content type (i.e. 'application/json').
- Parameters:
contentType
- Content-Type value
-
toPostBodyString
static String toPostBodyString(GraphQLRequestParams params)
Convert the GraphQL request parameters input data to an HTTP POST body string.
- Parameters:
params
- GraphQL request parameter input data
-
queryToGetParamValue
static String queryToGetParamValue(String query)
Convert the GraphQL Query input string into an HTTP GET request parameter value.
- Parameters:
query
- the GraphQL Query input string
-
variablesToGetParamValue
static String variablesToGetParamValue(String variables)
Convert the GraphQL Variables JSON input string into an HTTP GET request parameter value.
- Parameters:
variables
- the GraphQL Variables JSON input string
-
toGraphQLRequestParams
static GraphQLRequestParams toGraphQLRequestParams(Array<byte> postData, String contentEncoding)
Parse
postData
and convert it to a GraphQLRequestParams object if it is a valid GraphQL post data.- Parameters:
postData
- post datacontentEncoding
- content encoding
-
toGraphQLRequestParams
static GraphQLRequestParams toGraphQLRequestParams(Arguments arguments, String contentEncoding)
Parse
arguments
and convert it to a GraphQLRequestParams object if it has valid GraphQL HTTP arguments.- Parameters:
arguments
- argumentscontentEncoding
- content encoding
-
-
-
-