Class/Object

org.coursera.naptime.ari.graphql

SangriaGraphQlSchemaBuilder

Related Docs: object SangriaGraphQlSchemaBuilder | package graphql

Permalink

class SangriaGraphQlSchemaBuilder extends StrictLogging

Linear Supertypes
StrictLogging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SangriaGraphQlSchemaBuilder
  2. StrictLogging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SangriaGraphQlSchemaBuilder(resources: Set[Resource], schemas: Map[String, RecordDataSchema])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def buildEnumType(pegasusEnumSchema: EnumDataSchema): EnumType[String]

    Permalink

    Builds a Sangria enum from a Pegasus enum schema

    Builds a Sangria enum from a Pegasus enum schema

    pegasusEnumSchema

    Pegasus representation of the enum schema

    returns

    Sangria EnumType schema

  6. def buildFullyQualifiedName(namespace: String, fieldName: String): String

    Permalink
  7. def buildRecordType(pegasusRecordSchema: RecordDataSchema, namespace: String): ObjectType[SangriaGraphQlContext, DataMap]

    Permalink

    Builds a Sangria record from a Pegasus record schema

    Builds a Sangria record from a Pegasus record schema

    pegasusRecordSchema

    Pegasus representation of the record schema

    namespace

    namespace for the record (potentially used for child types)

    returns

    Sangria ObjectType schema

  8. def buildUnionType(pegasusUnionSchema: UnionDataSchema, fieldName: String, namespace: String): UnionType[SangriaGraphQlContext]

    Permalink

    Builds a Sangria union from a Pegasus union schema

    Builds a Sangria union from a Pegasus union schema

    pegasusUnionSchema

    Pegasus representation of the union schema

    fieldName

    field name for the union (used for creating member type names)

    namespace

    namespace for the union (used for creating member type names)

    returns

    Sangria UnionType with member object representations

  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def formatName(name: String): String

    Permalink

    Converts a field or namespace name to a GraphQL compatible name, replacing '.' with '_'

    Converts a field or namespace name to a GraphQL compatible name, replacing '.' with '_'

    name

    Original field name

    returns

    GraphQL-safe field name

  14. def formatResourceName(resource: Resource): String

    Permalink

    Converts a resource name to a GraphQL compatible name.

    Converts a resource name to a GraphQL compatible name. (i.e. 'courses.v1' to 'CoursesV1')

    resource

    Naptime resource

    returns

    GraphQL-safe resource name

  15. def formatResourceTopLevelName(resource: Resource): String

    Permalink

    Converts a resource to a GraphQL top-level name.

    Converts a resource to a GraphQL top-level name. (i.e. 'courses.v1' to 'CoursesV1Resource')

    resource

    Naptime resource

    returns

    GraphQL-safe top-level resource name

  16. def generateField(field: Field, namespace: String): Field[SangriaGraphQlContext, DataMap]

    Permalink

    Generates a single GraphQL schema field for a RecordDataSchema field type.

    Generates a single GraphQL schema field for a RecordDataSchema field type. If the field is marked as a related resource, generates the field as a relationship to the associated resource. Otherwise, generates a generic schema for the model definition.

    field

    RecordDataSchema.Field for the field, pulled off the Courier schema for the model

    namespace

    The namespace for the source model, used to prevent name collisions

    returns

    GraphQL schema Field with nested schema information

  17. def generateLookupTypeForResource(resourceName: String): ObjectType[SangriaGraphQlContext, DataMap]

    Permalink

    Generates an object-type for a given resource name, with each field on the merged output schema available on this object-type.

    Generates an object-type for a given resource name, with each field on the merged output schema available on this object-type.

    resourceName

    String name of the resource (i.e. 'courses.v1')

    returns

    ObjectType for the resource

  18. def generateObjectTypeForResource(resourceName: String): ObjectType[SangriaGraphQlContext, DataMap]

    Permalink

    Generates an object-type for a given resource name, with each field on the merged output schema available on this object-type.

    Generates an object-type for a given resource name, with each field on the merged output schema available on this object-type.

    resourceName

    String name of the resource (i.e. 'courses.v1')

    returns

    ObjectType for the resource

  19. def generateSchema(): Schema[SangriaGraphQlContext, DataMap]

    Permalink

    Generates a GraphQL schema for the provided set of resources to this class Returns a "root" object that has one field available for each Naptime Resource provided.*

    Generates a GraphQL schema for the provided set of resources to this class Returns a "root" object that has one field available for each Naptime Resource provided.*

    returns

    a Sangria GraphQL Schema with all resources defined

  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def getResource(resourceName: String): Resource

    Permalink

    Finds a resource with a given name from the provided list of resources, or throws an exception if the resource cannot be found.

    Finds a resource with a given name from the provided list of resources, or throws an exception if the resource cannot be found.

    resourceName

    string name, in the format courses.v1 or CoursesV1

    returns

    Resource object

  22. def getSangriaResolverForSchema(schemaType: DataSchema, fieldName: String): (Context[SangriaGraphQlContext, DataMap]) ⇒ Value[SangriaGraphQlContext, Any]

    Permalink

    Provides the resolver for a schema type, which implements how to retrieve a value from the raw data type.

    Provides the resolver for a schema type, which implements how to retrieve a value from the raw data type. For instance, for the Integer type, it pulls an integer out of a DataMap and converts the types as appropriate.

    schemaType

    Pegasus data schema type for the field

    fieldName

    name of the field (to pull the value out of the data map)

    returns

    Sangria Value with the value and Sangria context on it

  23. def getSangriaTypeForSchema(schemaType: DataSchema, fieldName: String, namespace: String): OutputType[Any]

    Permalink

    Converts a Pegasus DataSchema to Sangria GraphQL Schema type for use when generating a schema.

    Converts a Pegasus DataSchema to Sangria GraphQL Schema type for use when generating a schema.

    Nested objects schemas are computed recursively. Union types generate child ObjectTypes for their member classes

    schemaType

    DataSchema from the field, which specifies the source field type

    fieldName

    The field's name, which is used to generate union field member types

    namespace

    The field's namespace, which is used to prevent name colissions.

    returns

    Sangria GraphQL OutputType, which represents the structure of the field in the schema

  24. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  26. val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    StrictLogging
  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. def scalaTypeToFromInput(typeName: String): FromInput[Any]

    Permalink
  31. def scalaTypeToSangria(typeName: String): InputType[Any]

    Permalink
  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  33. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  34. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from StrictLogging

Inherited from AnyRef

Inherited from Any

Ungrouped