GraphQL

caliban.GraphQL
See theGraphQL companion object
trait GraphQL[-R]

A GraphQL[-R] represents a GraphQL API whose execution requires a ZIO environment of type R.

It is intended to be created only once, typically when you start your server. The introspection schema will be generated when this class is instantiated.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Value members

Concrete methods

final def @@[LowerR <: UpperR, UpperR <: R](aspect: GraphQLAspect[LowerR, UpperR]): GraphQL[UpperR]

Attaches an aspect that will wrap the entire GraphQL so that it can be manipulated. This method is a higher-level abstraction of withWrapper which allows the caller to completely replace or change all aspects of the schema.

Attaches an aspect that will wrap the entire GraphQL so that it can be manipulated. This method is a higher-level abstraction of withWrapper which allows the caller to completely replace or change all aspects of the schema.

Attributes

aspect

A wrapper type that will be applied to this GraphQL

Returns:

A new GraphQL API

final def combine[R1 <: R](that: GraphQL[R1]): GraphQL[R1]

Merges this GraphQL API with another GraphQL API. In case of conflicts (same field declared on both APIs), fields from that API will be used.

Merges this GraphQL API with another GraphQL API. In case of conflicts (same field declared on both APIs), fields from that API will be used.

Attributes

that

another GraphQL API object

Returns:

a new GraphQL API

final def enable(feature: Feature): GraphQL[R]
final def interpreter(implicit trace: Trace): IO[ValidationError, GraphQLInterpreter[R, CalibanError]]

Creates an interpreter from your API. A GraphQLInterpreter is a wrapper around your API that allows adding some middleware around the query execution. Fails with a caliban.CalibanError.ValidationError if the schema is invalid.

Creates an interpreter from your API. A GraphQLInterpreter is a wrapper around your API that allows adding some middleware around the query execution. Fails with a caliban.CalibanError.ValidationError if the schema is invalid.

Attributes

final def rename(queriesName: Option[String], mutationsName: Option[String], subscriptionsName: Option[String]): GraphQL[R]

Renames the root queries, mutations and subscriptions objects.

Renames the root queries, mutations and subscriptions objects.

Attributes

mutationsName

a new name for the root mutations object

queriesName

a new name for the root queries object

subscriptionsName

a new name for the root subscriptions object

Returns:

a new GraphQL API

final def render: String

Returns a string that renders the API types into the GraphQL format.

Returns a string that renders the API types into the GraphQL format.

Attributes

final def toDocument: Document

Converts the schema to a Document.

Converts the schema to a Document.

Attributes

final def withAdditionalDirectives(directives: List[`__Directive`]): GraphQL[R]
final def withAdditionalTypes(types: List[`__Type`]): GraphQL[R]

Adds linking to additional types which are unreachable from the root query.

Adds linking to additional types which are unreachable from the root query.

Attributes

types

The type definitions to add.

Note:

This is for advanced usage only i.e. when declaring federation type links

final def withSchemaDirectives(directives: List[Directive]): GraphQL[R]
final def withWrapper[R2 <: R](wrapper: Wrapper[R2]): GraphQL[R2]

Attaches a function that will wrap one of the stages of query processing (parsing, validation, execution, field execution or overall).

Attaches a function that will wrap one of the stages of query processing (parsing, validation, execution, field execution or overall).

Attributes

wrapper

a wrapping function

Returns:

a new GraphQL API

final def |+|[R1 <: R](that: GraphQL[R1]): GraphQL[R1]

Operator alias for combine.

Operator alias for combine.

Attributes