Class ResourceDocumentSource
java.lang.Object
org.springframework.graphql.support.ResourceDocumentSource
- All Implemented Interfaces:
- DocumentSource
DocumentSource that searches for document Resources across
 multiple locations while trying different file extensions.- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev, Marco Schäck
- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe default file extensions, ".graphql" and ".gql".
- 
Constructor SummaryConstructorsConstructorDescriptionDefault 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.ResourceDocumentSource(Resource location) Constructor with a single location and the default file extensions.
- 
Method SummaryModifier and TypeMethodDescriptionreactor.core.publisher.Mono<String> getDocument(String name) Return the document that matches the given name.Return a read-only list with the file extensions to try when checking for documents by name.Return a read-only list with the configured locations where to check for documents.
- 
Field Details- 
FILE_EXTENSIONS
 
- 
- 
Constructor Details- 
ResourceDocumentSourcepublic ResourceDocumentSource()Default constructor that sets the location to"classpath:graphql/"and the extensions to ".graphql" and ".gql".
- 
ResourceDocumentSourceConstructor with a single location and the default file extensions.- Parameters:
- location- the resource location
- Since:
- 2.0.0
 
- 
ResourceDocumentSource
 
- 
- 
Method Details- 
getLocations
- 
getExtensions
- 
getDocumentDescription copied from interface:DocumentSourceReturn the document that matches the given name.- Specified by:
- getDocumentin interface- DocumentSource
- Parameters:
- name- the name to use for the lookup
- Returns:
- Monothat completes either with the document content or with an error, but never empty.
 
 
-