Class GraphQLFactory
java.lang.Object
io.github.qubitpi.athena.metastore.graphql.GraphQLFactory
GraphQLFactory
initializes native GraphQL API
.-
Constructor Summary
ConstructorDescriptionGraphQLFactory
(@NotNull graphql.schema.DataFetcher<MetaData> queryDataFetcher, @NotNull graphql.schema.DataFetcher<MetaData> mutationDataFetcher) Constructor. -
Method Summary
Modifier and TypeMethodDescription@NotNull graphql.GraphQL
getApi()
Returns thenative GraphQL API
factorized.static @NotNull String
getGraphQLSchemaResourceAsString
(@NotNull String resourceName) Loads a resource file into a singleString
object.
-
Constructor Details
-
GraphQLFactory
public GraphQLFactory(@NotNull @NotNull graphql.schema.DataFetcher<MetaData> queryDataFetcher, @NotNull @NotNull graphql.schema.DataFetcher<MetaData> mutationDataFetcher) Constructor.- Parameters:
queryDataFetcher
- An application defined logic for retrieving file metadata from various databasesmutationDataFetcher
- An application defined logic for saving/updating file metadata into various databases- Throws:
NullPointerException
- ifqueryDataFetcher
ormutationDataFetcher
isnull
-
-
Method Details
-
getGraphQLSchemaResourceAsString
@NotNull public static @NotNull String getGraphQLSchemaResourceAsString(@NotNull @NotNull String resourceName) Loads a resource file into a singleString
object.- Parameters:
resourceName
- cannot be null- Returns:
- a resource file content
- Throws:
NullPointerException
- ifresourceName
isnull
IllegalStateException
- ifresourceName
corresponds a non-existing file source
-
getApi
@NotNull public @NotNull graphql.GraphQL getApi()Returns thenative GraphQL API
factorized.- Returns:
- the same instance
-