Class TypeRuntimeWiring.Builder

java.lang.Object
graphql.schema.idl.TypeRuntimeWiring.Builder
Enclosing class:
TypeRuntimeWiring

public static class TypeRuntimeWiring.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • typeName

      public TypeRuntimeWiring.Builder typeName(String typeName)
      Sets the type name for this type wiring. You MUST set this.
      Parameters:
      typeName - the name of the type
      Returns:
      the current type wiring
    • strictMode

      public TypeRuntimeWiring.Builder strictMode(boolean strictMode)
      This puts the builder into strict mode, so if things get defined twice, for example, it will throw a StrictModeWiringException.
      Returns:
      this builder
    • strictMode

      @Deprecated(since="2025-03-22", forRemoval=true) public TypeRuntimeWiring.Builder strictMode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This puts the builder into strict mode, so if things get defined twice, for example, it will throw a StrictModeWiringException.
      Returns:
      this builder
    • dataFetcher

      public TypeRuntimeWiring.Builder dataFetcher(String fieldName, DataFetcher dataFetcher)
      Adds a data fetcher for the current type to the specified field
      Parameters:
      fieldName - the field that data fetcher should apply to
      dataFetcher - the new data Fetcher
      Returns:
      the current type wiring
    • dataFetchers

      public TypeRuntimeWiring.Builder dataFetchers(Map<String,DataFetcher> dataFetchersMap)
      Adds data fetchers for the current type to the specified field
      Parameters:
      dataFetchersMap - a map of fields to data fetchers
      Returns:
      the current type wiring
    • defaultDataFetcher

      public TypeRuntimeWiring.Builder defaultDataFetcher(DataFetcher dataFetcher)
      All fields in a type need a data fetcher of some sort and this method is called to provide the default data fetcher that will be used for this type if no specific one has been provided per field.
      Parameters:
      dataFetcher - the default data fetcher to use for this type
      Returns:
      the current type wiring
    • typeResolver

      public TypeRuntimeWiring.Builder typeResolver(TypeResolver typeResolver)
      Adds a TypeResolver to the current type. This MUST be specified for Interface and Union types.
      Parameters:
      typeResolver - the type resolver in play
      Returns:
      the current type wiring
    • enumValues

      public TypeRuntimeWiring.Builder enumValues(EnumValuesProvider enumValuesProvider)
    • build

      public TypeRuntimeWiring build()
      Returns:
      the built type wiring