All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.intuit.graphql.orchestrator.ServiceProvider Maven / Gradle / Ivy

There is a newer version: 5.0.26
Show newest version
package com.intuit.graphql.orchestrator;

import com.intuit.graphql.orchestrator.batch.QueryExecutor;
import java.util.Collections;
import java.util.Map;
import java.util.Set;

/**
 * Represents a Service Provider.
 */
public interface ServiceProvider extends QueryExecutor {

  /**
   * The namespace needs to be unique per provider. This will be appended to each type of the service in the overall
   * schema. This also helps keep the provider's types separate from the other providers and helps in type conflict
   * resolution.
   *
   * @return A unique identifier for the service provider.
   */
  String getNameSpace();

  /**
   * This will represent your graphql schema, you can keep it in single file as well as multiple files.
   *
   * @return The graphql schema files.
   */
  Map sdlFiles();

  default Set domainTypes() {
    return Collections.emptySet();
  }

  default ServiceType getSeviceType() {
    return ServiceType.GRAPHQL;
  }

  default boolean isFederationProvider() { return getSeviceType() == ServiceType.FEDERATION_SUBGRAPH; }

  enum ServiceType {
    FEDERATION_SUBGRAPH,
    GRAPHQL,
    REST
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy