Class ObjectDefinition

java.lang.Object
no.sikt.graphitron.definitions.objects.AbstractObjectDefinition<T,U>
no.sikt.graphitron.definitions.objects.RecordObjectDefinition<graphql.language.ObjectTypeDefinition,ObjectField>
no.sikt.graphitron.definitions.objects.ObjectDefinition
All Implemented Interfaces:
GenerationTarget, ObjectSpecification<ObjectField>, RecordObjectSpecification<ObjectField>

public class ObjectDefinition extends RecordObjectDefinition<graphql.language.ObjectTypeDefinition,ObjectField>
Represents the default GraphQL object. Objects which do not fall within a different object category will become instances of this class. This is typically the only object type used in table referencing and joining operations.
  • Constructor Details

    • ObjectDefinition

      public ObjectDefinition(graphql.language.ObjectTypeDefinition objectDefinition)
  • Method Details

    • createFields

      protected List<ObjectField> createFields(graphql.language.ObjectTypeDefinition objectDefinition)
      Specified by:
      createFields in class AbstractObjectDefinition<graphql.language.ObjectTypeDefinition,ObjectField>
    • isOperationRoot

      public boolean isOperationRoot()
      Specified by:
      isOperationRoot in interface ObjectSpecification<ObjectField>
      Overrides:
      isOperationRoot in class AbstractObjectDefinition<graphql.language.ObjectTypeDefinition,ObjectField>
      Returns:
      Is this object the top node? That should be either the Query or the Mutation type.
    • getTypeDefinition

      public graphql.language.ObjectTypeDefinition getTypeDefinition()
      Returns:
      The original interpretation of this object as provided by GraphQL.
    • isGeneratedWithResolver

      public boolean isGeneratedWithResolver()
      Specified by:
      isGeneratedWithResolver in interface GenerationTarget
      Overrides:
      isGeneratedWithResolver in class RecordObjectDefinition<graphql.language.ObjectTypeDefinition,ObjectField>
      Returns:
      Should this object be generated as or containing resolvers?
    • processObjectDefinitions

      public static List<ObjectDefinition> processObjectDefinitions(List<graphql.language.ObjectTypeDefinition> objects)
      Creates instances of this class for each of the ObjectTypeDefinition provided.
      Returns:
      List of ObjectDefinitions.
    • implementsInterface

      public boolean implementsInterface(String interfaceName)
      Returns:
      Does this object implement this interface?
    • getImplementedInterfaces

      public LinkedHashSet<String> getImplementedInterfaces()
    • getDiscriminator

      public String getDiscriminator()
    • hasDiscriminator

      public boolean hasDiscriminator()