Refine documentSource locations

Closes gh-338
This commit is contained in:
rstoyanchev
2022-04-01 21:39:21 +01:00
parent 9289f0a1b5
commit 696f2cd02f
11 changed files with 68 additions and 18 deletions

View File

@@ -295,9 +295,11 @@ For example:
The document for a request is a `String` that may be defined in a local variable or
constant, or it may be produced through a code generated request object.
Alternatively, you can also keep documents in files with extensions `.graphql` or `
.gql`, on the classpath or anywhere else, and refer to those by file name. For example,
given:
You can also create document files with extensions `.graphql` or `.gql` under
`"graphql-documents/"` on the classpath and refer to them by file name.
For example, given a file called `projectReleases.graphql` in
`src/main/resources/graphql-documents`, with content:
[source,graphql,indent=0,subs="verbatim,quotes"]
.src/main/resources/graphql/project.graphql
@@ -316,7 +318,7 @@ You can then:
[source,java,indent=0,subs="verbatim,quotes"]
----
Mono<Project> projectMono = graphQlClient.documentName("project") <1>
Mono<Project> projectMono = graphQlClient.documentName("projectReleases") <1>
.variable("slug", "spring-framework") <2>
.retrieve()
.toEntity(Project.class);

View File

@@ -281,8 +281,10 @@ project release versions from the response:
The JsonPath is relative to the "data" section of the response.
You can also create document files with extensions `.graphql` or `.gql` under
`"graphql/"` on the classpath and refer to them by file name. For example, given a file
called `projectReleases.graphql` in `src/main/resources/graphql`, with content:
`"graphql-test/"` on the classpath and refer to them by file name.
For example, given a file called `projectReleases.graphql` in
`src/main/resources/graphql-test`, with content:
[source,graphql,indent=0,subs="verbatim,quotes"]
----