Skip to content

Commit 0343ad9

Browse files
committed
Update docs with section on Schema Creation
Closes gh-226
1 parent bde86d3 commit 0343ad9

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

spring-graphql-docs/src/docs/asciidoc/index.adoc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ support for <<execution-reactive-datafetcher>>, <<execution-context>>, and
188188
<<execution-exceptions>>.
189189

190190

191-
192191
[[execution-graphqlsource-schema-resources]]
193192
==== Schema Resources
194193

@@ -200,6 +199,27 @@ via `FileSystemResource`, to byte content via `ByteArrayResource`, or implement
200199
`Resource` that loads schema files from a remote location or storage.
201200

202201

202+
[[execution-graphqlsource-schema-creation]]
203+
==== Schema Creation
204+
205+
By default, `GraphQlSource.Builder` uses the GraphQL Java `GraphQLSchemaGenerator` to
206+
create the `graphql.schema.GraphQLSchema`. This works for most applications, but if
207+
necessary, you can hook into the schema creation through the builder:
208+
209+
[source,java,indent=0,subs="verbatim,quotes"]
210+
----
211+
GraphQlSource graphQlSource = GraphQlSource.builder()
212+
.schemaResources(..)
213+
.configureRuntimeWiring(..)
214+
.schemaFactory((typeDefinitionRegistry, runtimeWiring) -> {
215+
// create `GraphQLSchema`
216+
})
217+
.build();
218+
----
219+
220+
The primary reason for this is to create the schema through a federation library.
221+
222+
203223
[[execution-graphqlsource-runtimewiring-configurer]]
204224
==== `RuntimeWiringConfigurer`
205225

0 commit comments

Comments
 (0)