Interface GraphQLQueryProvider
public interface GraphQLQueryProvider
GraphQLQueryProvider
is an abstraction layer that constructs GraphQL queries on file metadata.
Implementation must be package-scoped and let GraphQLQueryProviderFactory
as the broker for their instance
provision
-
Method Summary
Modifier and TypeMethodDescription@NotNull String
Constructs and returns a GraphQL file metadata Mutation document given aMetaData
object to be saved and a specified file ID associated with the metadata.@NotNull String
Constructs and returns a GraphQL file metadata Query document given the specified file ID associated with the requested metadata and the metadata fields.
-
Method Details
-
query
@NotNull @NotNull String query(@NotNull @NotNull String fileId, @NotNull @NotNull List<String> metadataFields) Constructs and returns a GraphQL file metadata Query document given the specified file ID associated with the requested metadata and the metadata fields.For example, if file ID is "df32wsv3rr3ed", and the requested metadata fields are ["fileType", "fileName"], this method will return a string of
query { metaData(fileId: "df32wsv3rr3ed") { fileType fileName } }
- Parameters:
fileId
- The file ID associated with the requested metadata infometadataFields
- The requested metadata fields- Returns:
- a GraphQL query
- Throws:
NullPointerException
- iffileId
ormetadataFields
isnull
IllegalArgumentException
- ifmetadataFields
list is empty
-
mutation
@NotNull @NotNull String mutation(@NotNull @NotNull String fileId, @NotNull @NotNull MetaData metaData) Constructs and returns a GraphQL file metadata Mutation document given aMetaData
object to be saved and a specified file ID associated with the metadata.For example, if file ID is "df32wsv3rr3ed", and the metadata to be saved is
{"fileType": "PDF", "fileName": "Pride and Prejudice"}
, then this method will return a string ofmutation createMetaData { createMetaData(fileId: "df32wsv3rr3ed", fileName: "Pride and Prejudice", fileType: "PDF") { fileName, fileType } }
- Parameters:
fileId
- The file ID associated with the requested metadata infometaData
- An object that contains all information about the new metadata to be saved- Returns:
- a GraphQL query that creates a new
MetaData
object in database - Throws:
NullPointerException
- iffileId
ormetaData
isnull
-