Package 

Class FederatedSchemaGeneratorHooks

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

    
    public class FederatedSchemaGeneratorHooks
     implements SchemaGeneratorHooks
                        

    Hooks for generating federated GraphQL schema.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • 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
      KotlinDirectiveWiringFactory getWiringFactory()
      GraphQLType willGenerateGraphQLType(KType type) Add support for _FieldSet scalar to the schema.
      GraphQLDirective willGenerateDirective(DirectiveMetaInformation directiveInfo)
      GraphQLType didGenerateGraphQLType(KType type, GraphQLType generatedType)
      GraphQLSchema.Builder willBuildSchema(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.federation.FederatedSchemaGeneratorHooks

        didGenerateMutationField, didGenerateMutationObject, didGenerateQueryField, didGenerateSubscriptionField, didGenerateSubscriptionObject, 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(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 willBuildSchema, query has to have at least one single field.

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