public class ResourceDocumentSource extends Object implements DocumentSource
DocumentSource that looks for a document Resource under a set
of locations and trying a number of different file extension.| Modifier and Type | Field and Description |
|---|---|
static List<String> |
FILE_EXTENSIONS
The default file extensions, ".graphql" and ".gql".
|
| Constructor and Description |
|---|
ResourceDocumentSource()
Default constructor that sets the location to
"classpath:graphql/"
and the extensions to ".graphql" and ".gql". |
ResourceDocumentSource(List<Resource> locations,
List<String> extensions)
Constructor with given locations and extensions.
|
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<String> |
getDocument(String name)
Return the document that matches the given name.
|
List<String> |
getExtensions()
Return a read-only list with the file extensions to try when checking
for documents by name.
|
List<Resource> |
getLocations()
Return a read-only list with the configured locations where to check for
documents.
|
public ResourceDocumentSource()
"classpath:graphql/"
and the extensions to ".graphql" and ".gql".public List<Resource> getLocations()
public List<String> getExtensions()
public reactor.core.publisher.Mono<String> getDocument(String name)
DocumentSourcegetDocument in interface DocumentSourcename - the name to use for the lookupMono that completes either with the document content or
with an error, but never empty.