-</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 “graphql” containing JSON object with fields:<ul><li>query</li><li>operationName (optional)</li><li>variables (optional)</li></ul></li><li>POST multipart parts named “query”, “operationName” (optional), and “variables” (optional)</li><li>POST with Content Type “application/graphql” 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>
0 commit comments