These starters intend to be used
with spring-boot-starter-graphql, but it will work
without it, you just need to provide GraphQL path as spring.graphql.path
parameter.
GraphQL Voyager becomes accessible at root /voyager
(or as configured in spring.graphql.voyager.path
).
Available Spring Boot configuration parameters (either application.yml
or application.properties
):
spring:
graphql:
voyager:
enabled: true
path: /voyager
displayOptions:
skipRelay: true
skipDeprecated: true
rootType: Query
sortByAlphabet: false
showLeafFields: true
hideRoot: false
hideDocs: false
hideSettings: false
cdn: unpkg
stylePath: /style.css
<dependency>
<groupId>ru.sadv1r.spring.graphql</groupId>
<artifactId>graphql-voyager-spring-boot-starter</artifactId>
<version>0.7.0</version>
</dependency>
implementation 'ru.sadv1r.spring.graphql:graphql-voyager-spring-boot-starter:0.7.0'
GraphiQL becomes accessible at root /graphiql
(or as configured in spring.graphql.graphiql.path
).
Available Spring Boot configuration parameters (either application.yml
or application.properties
):
spring:
graphql:
graphiql:
enabled: true
path: /graphiql
default-query: |-
query($id: ID!) {
artifactRepository(id: $id) {
name
url
}
}
default-headers:
x-test: test
default-editor-tools-visibility: VARIABLES
variables:
id: 1
plugins: EXPLORER
cdn: unpkg
stylePath: /style.css
Since setting (large) query in the properties like this isn't very readable, you can provide a file path instead:
spring:
graphql:
graphiql:
enabled: true
default-query: example/query.graphql
<dependency>
<groupId>ru.sadv1r.spring.graphql</groupId>
<artifactId>graphql-graphiql-spring-boot-starter</artifactId>
<version>0.7.0</version>
</dependency>
implementation 'ru.sadv1r.spring.graphql:graphql-graphiql-spring-boot-starter:0.7.0'