Class DirectiveRegistryImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static DirectiveRegistry directiveRegistry
      As we may have or not have Spring at runtime, we manually manage a singleton.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Directive getDirective​(java.lang.String name)
      Retrieves the registered GraphQLScalarType for this GraphQL CustomScalar.
      void registerAllDirectives()
      This method registers all GraphQLScalarType that are declared as Spring Component.
      void registerDirective​(Directive type)
      Manually register one GraphQL directive.
      • Methods inherited from class java.lang.Object

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

      • directiveRegistry

        public static DirectiveRegistry directiveRegistry
        As we may have or not have Spring at runtime, we manually manage a singleton. This field is private, and should only be accessed through #getDirectiveRegistry().
    • Constructor Detail

      • DirectiveRegistryImpl

        public DirectiveRegistryImpl()
    • Method Detail

      • registerAllDirectives

        public void registerAllDirectives()
        This method registers all GraphQLScalarType that are declared as Spring Component. Another way to register GraphQLScalarType is to call the #registerGraphQLScalarType(GraphQLScalarType).
        This implementation works only if this class has been loaded as a Spring Component.
        Specified by:
        registerAllDirectives in interface DirectiveRegistry
      • getDirective

        public Directive getDirective​(java.lang.String name)
        Retrieves the registered GraphQLScalarType for this GraphQL CustomScalar.
        Specified by:
        getDirective in interface DirectiveRegistry
        Returns:
        the Directive, or null if no directive has been registered for the given name