Class FederatedSchemaGeneratorHooks

  • All Implemented Interfaces:
    com.expediagroup.graphql.generator.hooks.SchemaGeneratorHooks

    
    public class FederatedSchemaGeneratorHooks
     implements SchemaGeneratorHooks
                        

    Hooks for generating federated GraphQL schema.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final KotlinDirectiveWiringFactory wiringFactory
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      GraphQLSchema.Builder willBuildSchema(List<TopLevelObject> queries, List<TopLevelObject> mutations, List<TopLevelObject> subscriptions, Set<KType> additionalTypes, Set<KType> additionalInputTypes, TopLevelObject schemaObject)
      GraphQLType willGenerateGraphQLType(KType type) Add support for FieldSet and LinkImport scalars to the schema.
      GraphQLDirective willGenerateDirective(DirectiveMetaInformation directiveInfo)
      GraphQLAppliedDirective willApplyDirective(DirectiveMetaInformation directiveInfo, GraphQLDirective directive)
      GraphQLType didGenerateGraphQLType(KType type, GraphQLType generatedType)
      GraphQLDirective didGenerateDirective(DirectiveMetaInformation directiveInfo, GraphQLDirective directive)
      GraphQLSchema.Builder didBuildSchema(GraphQLSchema.Builder builder)
      GraphQLObjectType didGenerateQueryObject(GraphQLObjectType type) Federated service may not have any regular queries but will have federated queries.
      • Methods inherited from class com.expediagroup.graphql.generator.hooks.SchemaGeneratorHooks

        didApplyDirective, didGenerateMutationField, didGenerateMutationObject, didGenerateQueryField, didGenerateSubscriptionField, didGenerateSubscriptionObject, getWiringFactory, isValidAdditionalType, isValidFunction, isValidProperty, isValidSubscriptionReturnType, isValidSuperclass, onRewireGraphQLType, willAddGraphQLTypeToSchema, willResolveInputMonad, willResolveMonad
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • willBuildSchema

         GraphQLSchema.Builder willBuildSchema(List<TopLevelObject> queries, List<TopLevelObject> mutations, List<TopLevelObject> subscriptions, Set<KType> additionalTypes, Set<KType> additionalInputTypes, TopLevelObject schemaObject)
      • willApplyDirective

         GraphQLAppliedDirective willApplyDirective(DirectiveMetaInformation directiveInfo, GraphQLDirective directive)
      • didGenerateDirective

         GraphQLDirective didGenerateDirective(DirectiveMetaInformation directiveInfo, GraphQLDirective directive)
      • didBuildSchema

         GraphQLSchema.Builder didBuildSchema(GraphQLSchema.Builder builder)
      • didGenerateQueryObject

         GraphQLObjectType didGenerateQueryObject(GraphQLObjectType type)

        Federated service may not have any regular queries but will have federated queries. In order to ensure that we have a valid GraphQL schema that can be modified in the didBuildSchema, query has to have at least one single field.

        Add federated _service query to ensure it is a valid GraphQL schema.