Search in sources :

Example 1 with GraphQLConfiguration

use of com.graphql_java_generator.client.GraphQLConfiguration in project graphql-maven-plugin-project by graphql-java-generator.

the class FullRequestIT method setupAll.

@BeforeAll
static void setupAll() throws GraphQLRequestPreparationException {
    // We have one GraphQL endpoint. So we use the static configuration.
    GraphQLRequest.setStaticConfiguration(new GraphQLConfiguration(GRAPHQL_ENDPOINT_URL));
    // Let's build once the request, and use it for each further execution
    boardsRequest = new GraphQLRequest("query{boards{id name topics {id}}}");
}
Also used : GraphQLRequest(com.graphql_java_generator.samples.forum.client.graphql.forum.client.GraphQLRequest) GraphQLConfiguration(com.graphql_java_generator.client.GraphQLConfiguration) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 2 with GraphQLConfiguration

use of com.graphql_java_generator.client.GraphQLConfiguration in project graphql-maven-plugin-project by graphql-java-generator.

the class AbstractGraphQLRequest_fragmentTest method setup.

@BeforeEach
void setup() {
    // Default configuration for GraphQLRequest
    GraphQLRequest.setStaticConfiguration(new GraphQLConfiguration("http://localhost"));
    // A useful init for some tests
    input = new HumanInput();
    input.setName("a new name");
    List<Episode> episodes = new ArrayList<>();
    episodes.add(Episode.JEDI);
    episodes.add(Episode.EMPIRE);
    episodes.add(Episode.NEWHOPE);
    input.setAppearsIn(episodes);
    params.put("humanInput", input);
    params.put("value", "the mutation value");
    params.put("anotherValue", "the other mutation value");
    params.put("uppercaseFalse", false);
    params.put("uppercaseTrue", true);
}
Also used : Episode(com.graphql_java_generator.domain.client.allGraphQLCases.Episode) HumanInput(com.graphql_java_generator.domain.client.allGraphQLCases.HumanInput) ArrayList(java.util.ArrayList) GraphQLConfiguration(com.graphql_java_generator.client.GraphQLConfiguration) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with GraphQLConfiguration

use of com.graphql_java_generator.client.GraphQLConfiguration in project graphql-maven-plugin-project by graphql-java-generator.

the class FullRequestWithFragmentIT method setupAll.

@BeforeAll
static void setupAll() throws GraphQLRequestPreparationException {
    // We have one GraphQL endpoint. So we use the static configuration.
    GraphQLRequest.setStaticConfiguration(new GraphQLConfiguration(GRAPHQL_ENDPOINT_URL));
    // Let's build once the request, and use it for each further execution
    boardsRequestWithGlobalFragments = new GraphQLRequest(// 
    "" + "fragment member on Member {name alias} " + "fragment post on Post {date content author{...member   id}}\n" + "fragment topic on Topic {title posts(since: &sinceParam){id ...post} author{...member}}\r" + "query{boards{id name topics {id ...topic}}}");
    // The same request, with inline fragments
    boardsRequestWithInlineFragments = new GraphQLRequest(// 
    "" + // 
    "query{boards{" + // 
    "  id name topics {" + // 
    "     id ... on Topic {" + // 
    "         title " + // 
    "         posts(since: &sinceParam){id ... on Post {date content author{... on Member {name alias}   id}} } " + // 
    "         author{... on Member {name alias}}" + // 
    "     } " + // 
    "  }" + "}}");
}
Also used : GraphQLRequest(com.graphql_java_generator.samples.forum.client.graphql.forum.client.GraphQLRequest) GraphQLConfiguration(com.graphql_java_generator.client.GraphQLConfiguration) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

GraphQLConfiguration (com.graphql_java_generator.client.GraphQLConfiguration)3 GraphQLRequest (com.graphql_java_generator.samples.forum.client.graphql.forum.client.GraphQLRequest)2 BeforeAll (org.junit.jupiter.api.BeforeAll)2 Episode (com.graphql_java_generator.domain.client.allGraphQLCases.Episode)1 HumanInput (com.graphql_java_generator.domain.client.allGraphQLCases.HumanInput)1 ArrayList (java.util.ArrayList)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1