Adding a word about client that attack more than one GraphQL server
<part id="Code Generation">
<title>Code Generation</title>
- <!-- faq id="multiple_servers">
+ <faq id="multiple_servers">
<question>
How can I generate a client that can attack several GraphQL servers?
</question>
<answer>
- <p>some markup goes here</p>
+ <p>
+ In order to generate the source code for several GraphQL servers, you'll first need to separate the GraphQL
+ schema
+ in one folder par GraphQL server. This folder would typically be
+ <I>src/main/GraphQLServerName1</I>
+ . Then, you'll create an execution of the plugin for each such folder, like this:
+ </p>
+ <source>
+ <pre>
+ <plugin>
+ <groupId>com.graphql-java-generator</groupId>
+ <artifactId>graphql-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>graphql-generateCode</id>
+ <goals>
+ <goal>generateClientCode</goal>
+ </goals>
+ <configuration>
- <source>some source code</source>
+ ... Plugin parameters, for instance :
- <p>some markup goes here</p>
+ <packageName>org.allGraphQLCases.client</packageName>
+ <schemaFileFolder>src/main/GraphQLServerName1</schemaFileFolder>
+ <separateUtilityClasses>true</separateUtilityClasses>
+ <skipGenerationIfSchemaHasNotChanged>true</skipGenerationIfSchemaHasNotChanged>
+ </configuration>
+ </execution>
+ <execution>
+ <configuration>
+
+ ... Configuration for the src/main/GraphQLServerName2
+
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </pre>
+ </source>
+
+ <p>
+ Up to 1.12.2, in order to use these two GraphQL servers, you'll have to use the non spring app, as
+ <A HREF="https://graphql-maven-plugin-project.graphql-java-generator.com/client_non_spring.html">described here</A>
+ </p>
</answer>
- </faq-->
+ </faq>
</part>
</faqs>
\ No newline at end of file
