Class GraphQLConfiguration

java.lang.Object
com.graphql_java_generator.client.GraphQLConfiguration

@Component
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()
    The default constructor, that is used by Spring.
    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)
    Deprecated.
    GraphQLConfiguration​(java.lang.String graphqlEndpoint, javax.ws.rs.client.Client client, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    Deprecated.
  • Method Summary

    Modifier and Type Method Description
    QueryExecutor getQueryExecutor()
    Retrieves the QueryExecutor for this GraphQL configuration

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GraphQLConfiguration

      @Autowired public GraphQLConfiguration()
      The default constructor, that is used by Spring.
    • 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

      @Deprecated public GraphQLConfiguration​(java.lang.String graphqlEndpoint, javax.net.ssl.SSLContext sslContext, javax.net.ssl.HostnameVerifier hostnameVerifier)
      Deprecated.
      This method is deprecated since version v1.12. It is based on the Jersey Client, but this client has a hard to use the OAuth implementation. The default implementation of this implementation is now based on Spring
      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 and HostnameVerifier 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 endpoint
      sslContext -
      hostnameVerifier -
    • GraphQLConfiguration

      @Deprecated public GraphQLConfiguration​(java.lang.String graphqlEndpoint, javax.ws.rs.client.Client client, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Deprecated.
      This method is deprecated since version v1.12. It is based on the Jersey Client, but this client has a hard to use the OAuth implementation. The default implementation of this implementation is now based on Spring
      This constructor expects the URI of the GraphQL server and a configured JAX-RS client that gives the opportunity to customize the REST request
      For example: http://my.server.com/graphql
      Parameters:
      graphqlEndpoint - the http URI for the GraphQL endpoint
      client - Client javax.ws.rs.client.Client to support customization of the rest request
      objectMapper - ObjectMapper com.fasterxml.jackson.databind.ObjectMapper to support configurable mapping
  • Method Details