Class GraphQLFactory

java.lang.Object
io.github.qubitpi.athena.metastore.graphql.GraphQLFactory

@Singleton @Immutable @ThreadSafe public class GraphQLFactory extends Object
GraphQLFactory initializes native GraphQL API.
  • 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 databases
      mutationDataFetcher - An application defined logic for saving/updating file metadata into various databases
      Throws:
      NullPointerException - if queryDataFetcher or mutationDataFetcher is null
  • Method Details

    • getGraphQLSchemaResourceAsString

      @NotNull public static @NotNull String getGraphQLSchemaResourceAsString(@NotNull @NotNull String resourceName)
      Loads a resource file into a single String object.
      Parameters:
      resourceName - cannot be null
      Returns:
      a resource file content
      Throws:
      NullPointerException - if resourceName is null
      IllegalStateException - if resourceName corresponds a non-existing file source
    • getApi

      @NotNull public @NotNull graphql.GraphQL getApi()
      Returns the native GraphQL API factorized.
      Returns:
      the same instance