Skip to content

Commit 7135c5f

Browse files
committed
1 parent ebf2279 commit 7135c5f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

servlet/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<span style=color:#f92672>&lt;/snapshots&gt;</span>
4545
<span style=color:#f92672>&lt;/repository&gt;</span>
4646
<span style=color:#f92672>&lt;/repositories&gt;</span>
47-
</code></pre></div><h2 id=usage>Usage</h2><p>The servlet supports the following request formats:</p><ul><li>GET request to <code>../schema.json</code>: Get the result of an introspection query.</li><li>GET request with query parameters (query only, no mutation):<ul><li>query</li><li>operationName (optional)</li><li>variables (optional)</li></ul></li><li>POST body JSON object with fields:<ul><li>query</li><li>operationName (optional)</li><li>variables (optional)</li></ul></li><li>POST multipart part named &ldquo;graphql&rdquo; containing JSON object with fields:<ul><li>query</li><li>operationName (optional)</li><li>variables (optional)</li></ul></li><li>POST multipart parts named &ldquo;query&rdquo;, &ldquo;operationName&rdquo; (optional), and &ldquo;variables&rdquo; (optional)</li><li>POST with Content Type &ldquo;application/graphql&rdquo; will treat the HTTP POST body contents as the GraphQL query string</li></ul><h2 id=spring-framework-support>Spring Framework support</h2><p>To use the servlet with Spring Framework, either use the <a href=https://www.graphql-java-kickstart.com/spring-boot/>Spring Boot starter</a> or simply define a <code>ServletRegistrationBean</code> in a web app:</p><div class=highlight><pre style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-java data-lang=java><span style=color:#a6e22e>@Bean</span>
47+
</code></pre></div><h2 id=usage>Usage</h2><p>The servlet supports the following request formats:</p><ul><li>GET request to <code>../schema.json</code>: Get the result of an introspection query.</li><li>GET request with query parameters (query only, no mutation):<ul><li>query</li><li>operationName (optional)</li><li>variables (optional)</li></ul></li><li>POST body JSON object with fields:<ul><li>query</li><li>operationName (optional)</li><li>variables (optional)</li></ul></li><li>POST multipart part named &ldquo;graphql&rdquo; containing JSON object with fields:<ul><li>query</li><li>operationName (optional)</li><li>variables (optional)</li></ul></li><li>POST multipart parts named &ldquo;query&rdquo;, &ldquo;operationName&rdquo; (optional), and &ldquo;variables&rdquo; (optional)</li><li>POST with Content Type &ldquo;application/graphql&rdquo; will treat the HTTP POST body contents as the GraphQL query string</li></ul><h2 id=spring-framework-support>Spring Framework support</h2><p>To use the servlet with Spring Framework, either use the <a href=https://graphql-java-kickstart.github.io/spring-boot/>Spring Boot starter</a> or simply define a <code>ServletRegistrationBean</code> in a web app:</p><div class=highlight><pre style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-java data-lang=java><span style=color:#a6e22e>@Bean</span>
4848
ServletRegistrationBean <span style=color:#a6e22e>graphQLServletRegistrationBean</span><span style=color:#f92672>(</span>GraphQLSchema schema<span style=color:#f92672>,</span> ExecutionStrategy executionStrategy<span style=color:#f92672>,</span> List<span style=color:#f92672>&lt;</span>GraphQLOperationListener<span style=color:#f92672>&gt;</span> operationListeners<span style=color:#f92672>)</span> <span style=color:#f92672>{</span>
4949
<span style=color:#66d9ef>return</span> <span style=color:#66d9ef>new</span> ServletRegistrationBean<span style=color:#f92672>(</span><span style=color:#66d9ef>new</span> SimpleGraphQLServlet<span style=color:#f92672>(</span>schema<span style=color:#f92672>,</span> executionStrategy<span style=color:#f92672>,</span> operationListeners<span style=color:#f92672>),</span> <span style=color:#e6db74>&#34;/graphql&#34;</span><span style=color:#f92672>);</span>
5050
<span style=color:#f92672>}</span>

0 commit comments

Comments
 (0)