Class ObjectField

java.lang.Object
no.sikt.graphitron.definitions.fields.AbstractField<T>
no.sikt.graphitron.definitions.fields.GenerationSourceField<graphql.language.FieldDefinition>
no.sikt.graphitron.definitions.fields.ObjectField
All Implemented Interfaces:
FieldSpecification, GenerationField, GenerationTarget
Direct Known Subclasses:
VirtualSourceField

public class ObjectField extends GenerationSourceField<graphql.language.FieldDefinition>
Represents the default field type, which in addition to the generic field functionality also provides join operation data.
  • Field Details

    • RESERVED_PAGINATION_NAMES

      public static final List<String> RESERVED_PAGINATION_NAMES
  • Constructor Details

    • ObjectField

      public ObjectField(graphql.language.FieldDefinition field, String container)
  • Method Details

    • isFetchByID

      public boolean isFetchByID()
      Returns:
      Should this field use IDs to fetch record data?
    • hasForwardPagination

      public boolean hasForwardPagination()
      Returns:
      Does this search field use forward pagination? Does its type have the reserved "Connection" suffix?
    • hasBackwardPagination

      public boolean hasBackwardPagination()
      Returns:
      Does this search field use backward pagination? Does its type have the reserved "Connection" suffix?
    • hasPagination

      public boolean hasPagination()
      Returns:
      Does this search field use any form of pagination?
    • hasMutationType

      public boolean hasMutationType()
      Specified by:
      hasMutationType in interface GenerationField
      Overrides:
      hasMutationType in class GenerationSourceField<graphql.language.FieldDefinition>
      Returns:
      Does this field have a mutation operation defined?
    • getMutationType

      public MutationType getMutationType()
      Specified by:
      getMutationType in interface GenerationField
      Overrides:
      getMutationType in class GenerationSourceField<graphql.language.FieldDefinition>
      Returns:
      The type of mutation that should be applied in this operation.
    • getArguments

      public List<ArgumentField> getArguments()
      Returns:
      List of all input arguments for this field.
    • getArgumentByName

      public ArgumentField getArgumentByName(String name)
      Returns:
      Argument with this name if it exists.
    • hasArgument

      public boolean hasArgument(String name)
      Returns:
      Does this field contain this argument?
    • getFirstDefault

      public int getFirstDefault()
      Returns:
      Default value set for the after parameter.
    • getLastDefault

      public int getLastDefault()
      Returns:
      Default value set for the before parameter.
    • getNonReservedArguments

      public List<ArgumentField> getNonReservedArguments()
      Returns:
      List of all input non-reserved arguments for this field.
    • getNonReservedArgumentsWithOrderField

      public List<ArgumentField> getNonReservedArgumentsWithOrderField()
      Returns:
      List of all non-reserved and orderBy arguments for this field
    • hasInputFields

      public boolean hasInputFields()
      Returns:
      Does this field have any input fields defined?
    • hasNonReservedInputFields

      public boolean hasNonReservedInputFields()
      Returns:
      Does this field have any input fields defined that are not reserved?
    • hasRequiredPaginationFields

      public boolean hasRequiredPaginationFields()
      Returns:
      Does this field have any set of pagination fields?
    • from

      public static List<ObjectField> from(List<graphql.language.FieldDefinition> fields, String container)
      Returns:
      List of instances based on a list of FieldDefinition.
    • hasLookupKey

      public boolean hasLookupKey()
      Returns:
      Does this field contain an argument set as a key for a lookup operation?
    • getLookupKeys

      public LinkedHashSet<String> getLookupKeys()
      Returns:
      Set of fields that are configured to be used as lookup keys.
    • getOrderField

      public Optional<ArgumentField> getOrderField()
    • isInput

      public boolean isInput()