Class GraphQLConfiguration
java.lang.Object
com.graphql_java_generator.client.GraphQLConfiguration
public class GraphQLConfiguration
extends java.lang.Object
This class contains a GraphQL configuration for the GraphQL client. The main element of this configuration contains
- Author:
- etienne-sf
-
Constructor Summary
Constructors Constructor Description GraphQLConfiguration(java.lang.String graphqlEndpoint)
This constructor expects the URI of the GraphQL server.GraphQLConfiguration(java.lang.String graphqlEndpoint, javax.net.ssl.SSLContext sslContext, javax.net.ssl.HostnameVerifier hostnameVerifier)
This constructor expects the URI of the GraphQL server.GraphQLConfiguration(java.lang.String graphqlEndpoint, javax.ws.rs.client.Client client, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
This constructor expects the URI of the GraphQL server and a configured JAX-RS client that gives the opportunity to customise the REST request
For example: http://my.server.com/graphql -
Method Summary
Modifier and Type Method Description QueryExecutor
getQueryExecutor()
Retrieves theQueryExecutor
for this GraphQL configuration
-
Constructor Details
-
GraphQLConfiguration
public GraphQLConfiguration(java.lang.String graphqlEndpoint)This constructor expects the URI of the GraphQL server. This constructor works only for http servers, not for https ones.
For example: http://my.server.com/graphql- Parameters:
graphqlEndpoint
- the http URI for the GraphQL endpoint
-
GraphQLConfiguration
public GraphQLConfiguration(java.lang.String graphqlEndpoint, javax.net.ssl.SSLContext sslContext, javax.net.ssl.HostnameVerifier hostnameVerifier)This constructor expects the URI of the GraphQL server. This constructor works only for https servers, not for http ones.
For example: https://my.server.com/graphql
SSLContext
andHostnameVerifier
are regular Java stuff. You'll find lots of documentation on the web. The StarWars sample is based on the http://www.thinkcode.se/blog/2019/01/27/a-jersey-client-supporting-https blog. But this sample implements a noHostVerification, which of course, is the simplest but the safest way to go.- Parameters:
graphqlEndpoint
- the https URI for the GraphQL endpointsslContext
-hostnameVerifier
-
-
GraphQLConfiguration
public GraphQLConfiguration(java.lang.String graphqlEndpoint, javax.ws.rs.client.Client client, com.fasterxml.jackson.databind.ObjectMapper objectMapper)This constructor expects the URI of the GraphQL server and a configured JAX-RS client that gives the opportunity to customise the REST request
For example: http://my.server.com/graphql- Parameters:
graphqlEndpoint
- the http URI for the GraphQL endpointclient
-Client
javax.ws.rs.client.Client to support customization of the rest requestobjectMapper
-ObjectMapper
com.fasterxml.jackson.databind.ObjectMapper to support configurable mapping
-
-
Method Details
-
getQueryExecutor
Retrieves theQueryExecutor
for this GraphQL configuration
-