leto_schema library

Classes

AttachFn
Adds GraphQLAttachments to a generated GraphQLElement
AttachmentWithValidation
An attachment with validation
BaseGraphQLResolverDecorator
Base annotation for GraphQL resolvers.
BaseGraphQLTypeDecorator
Base type decorator.
ClassResolver
Signifies that a class should be used to generated and resolve a set of GraphQLObjectFields.
Ctx<P>
The context for a resolver in a given request. Contains the args passed as input, the parent object, the selected fields in lookahead, the scoped values in scope and other parent context such as objectCtx and the executionCtx for the request.
DocumentNode
EnumValue
Enum value parsed from the ast. Useful for distinguishing between enum and string values.
ExecutionCtx
The context associated with a request that finished being validated
FieldNode
FieldResolver<Value, P>
Wrapper class for GraphQLFieldResolver necessary for type casting.
FieldSubscriptionResolver<Value>
Wrapper class for GraphQLSubscriptionFieldResolver necessary for type casting.
GenericHelp<T>
Helper utilities for working with the generic type argument T.
GenericHelpSingle<T>
Helper utilities for working with the generic type argument T.
GenericHelpWithExtends<T extends E, E>
Helper utilities for working with the generic type argument T that extends E.
GraphQLArg
An annotation for configuring a GraphQLFieldInput within a resolver
GraphQLCompositeType<P>
A GraphQLType with nested properties
GraphQLDirective
Provides documentation, information or functionalities over different aspects of a GraphQL parsing, validation, execution or interpretation of a GraphQLSchema
GraphQLDocumentation
A metadata annotation used to provide documentation and type information to package:leto_generator in code generation
GraphQLElement
An element in a GraphQLSchema
GraphQLEnum
Signifies that a class should statically generate a GraphQLEnumType.
GraphQLEnumType<Value>
A GraphQLType with only a predetermined number of possible values.
GraphQLEnumValue<Value>
A variant of a GraphQLEnumType.
GraphQLEnumVariant
Signifies that a static field should statically generate a GraphQLEnumValue in a GraphQLEnumType.
GraphQLErrorLocation
Information about a location in source text that caused an error during the execution of a GraphQL query.
GraphQLField
An annotation for configuring the generated code of a GraphQL field
GraphQLFieldInput<Value, Serialized>
An input to a GraphQL field. This is analogous to a function parameter in Dart.
GraphQLInput
Signifies that a class should statically generate a GraphQLInputObjectType
GraphQLInputObjectType<Value>
A special GraphQLType that specifies the shape of an object that can only be used as an input to a GraphQLField.
GraphQLListType<Value, Serialized>
A special GraphQLType that indicates that input vales should be a list of another type ofType.
GraphQLNamedType<Value, Serialized>
A GraphQLType with non-null name.
GraphQLNonNullType<Value, Serialized>
A special GraphQLType that indicates that input values should both be non-null, and be valid when asserted against another type, named ofType.
GraphQLObject
Signifies that a class should statically generate a GraphQLType.
GraphQLObjectField<Value, Serialized, P>
A field on a GraphQLObjectType.
GraphQLObjectType<P>
A GraphQLType that specifies the shape of structured data, with multiple fields that can be resolved independently of one another.
GraphQLResolver
Signifies that a function should statically generate a GraphQLObjectField.
GraphQLScalarType<Value, Serialized>
A GraphQLType without nested properties. Can be used as an input type.
GraphQLScalarTypeValue<Value, Serialized>
A GraphQLType without nested properties. Can be used as an input type. Utility for creating a GraphQLScalarType, you can also extend it.
GraphQLSchema
The schema against which queries, mutations and subscriptions are executed.
GraphQLType<Value, Serialized>
Strictly dictates the structure of some input data in a GraphQL query.
GraphQLTypeDefinitionExtra<N extends TypeDefinitionNode, E extends TypeExtensionNode>
GraphQLUnion
Signifies that a class should statically generate a GraphQLUnionType.
GraphQLUnionType<P>
A special GraphQLType that indicates that an input value may be valid against one or more possibleTypes.
GraphQLWrapperType
A wrapper around a GraphQLType.
HotReloadableDefinition<T extends Object>
Creates an instance of a cached value that should be re-instantiated once _hotReloadCounter changes. Useful for hot reload.
IsTypeOfWrapper<P>
A function that returns true if result is an instance of GraphQLObjectType type
MutableValue<T>
A wrapper around a value that can be mutated
Mutation
Signifies that a function should statically generate a GraphQLObjectField within the mutation type of a GraphQLSchema.
ObjectExecutionCtx<P>
The context associated with an object execution in a request that finished being validated
ObjectField
A field in a GraphQLSchema
OperationDefinitionNode
PossibleSelections
PossibleSelectionsObject
Query
Signifies that a function should statically generate a GraphQLObjectField within the query type of a GraphQLSchema.
RequestCtx
The context associated with a request it may not be validated
ResolveTypeWrapper<T extends GraphQLType<Object?, Object?>>
A function that returns the name of one of the possible types of an given abstract type that matches the type for result.
ScopedHolder
A Object which holds a scope
ScopedMap
A map with values in different scopes
ScopedOverride<T>
An override of ref with the value returned from create.
ScopedRef<T>
A reference to a scoped value of type T
SerdeCtx
De-serialization context with Serializers for creating objects from serialized values
Serializer<T>
A class that deserializes values into types of type T
SerializerValue<T>
A Serializer from a fromJson function
SerializerValueGen<T>
Subscription
Signifies that a function should statically generate a GraphQLObjectField within the subscription type of a GraphQLSchema.
ToDirectiveValue
The implementors of this class specify that the instances represent a GraphQL directive. Can be used in GraphQLElement's attachments so that the directives are present in the schema.
ValidaAttachment
A GraphQL attachment which specifies a valida annotation in a GraphQLElement for validating input and outputs. Presented as a directive directiveDefinition in the GraphQL schema.
ValidationResult<Value>
Represents the result of asserting an input value against a GraphQLType.

Enums

DirectiveLocation
The position within the schema where a given directive can be
EnumNameCase
The String case associated with an enum variant name
OperationType
Enumeration of all known GraphQL operation types.

Extensions

DirectiveLocationEnumSerde on DirectiveLocation
GraphQLFieldTypeExt on GraphQLType<V, S>
Utility extensions for creating fields in a GraphQLSchema.
GraphQLNamedTypeExtension on GraphQLNamedType<Value, Serialized>
Extensions for GraphQLNamedType

Constants

DEFAULT_DEPRECATION_REASON → const String
Constant string used for default reason for a deprecation.
specifiedScalarNames → const List<String>
Names of all specified scalars

Properties

checkAsserts bool
Whether to check asserts in some GraphQL element constructors
getter/setter pair
graphQLBigInt GraphQLScalarType<BigInt, String>
A BigInt, serialized as an string.
final
graphQLBoolean GraphQLScalarType<bool, bool>
true or false.
final
graphQLDate GraphQLScalarType<DateTime, String>
A DateTime, serialized as an ISO-8601 string.
final
graphQLDeprecatedDirective GraphQLDirective
final
graphQLFloat GraphQLScalarType<double, double>
A signed double-precision floating-point value.
final
graphQLId GraphQLScalarType<String, Object>
The ID scalar type represents a unique identifier, often used to re-fetch an object or as the key for a cache.
final
graphQLIncludeDirective GraphQLDirective
final
graphQLInt GraphQLScalarType<int, int>
A signed integer.
final
graphQLOneOfDirective GraphQLDirective
final
graphQLSkipDirective GraphQLDirective
final
graphQLSpecifiedByDirective GraphQLDirective
final
graphQLString GraphQLScalarType<String, String>
A UTF‐8 character sequence.
final
graphQLTimestamp GraphQLScalarType<DateTime, int>
A DateTime, serialized as an UNIX timestamp.
final
graphQLUri GraphQLScalarType<Uri, String>
A GraphQLType for Uri values.
final
validaGraphQLDirective GraphQLDirective
The validation performed in a type, field or argument definition
final

Functions

copyFieldWithName<V, S, P>(String name, GraphQLObjectField<V, S, P> field) GraphQLObjectField<V, S, P>
Return a GraphQLObjectField with name and all other properties copied from field
enumType<Value>(String name, Map<String, Value> values, {String? description, GraphQLTypeDefinitionExtra<EnumTypeDefinitionNode, EnumTypeExtensionNode> extra = const GraphQLTypeDefinitionExtra.attach([])}) GraphQLEnumType<Value>
Shorthand for building a GraphQLEnumType.
enumTypeFromStrings(String name, Set<String> values, {String? description, GraphQLTypeDefinitionExtra<EnumTypeDefinitionNode, EnumTypeExtensionNode> extra = const GraphQLTypeDefinitionExtra.attach([])}) GraphQLEnumType<String>
Shorthand for building a GraphQLEnumType where all the possible values are mapped to Dart strings.
field<T, Serialized, P>(String name, GraphQLType<T, Serialized> type, {Iterable<GraphQLFieldInput<Object?, Object?>> inputs = const [], GraphQLFieldResolver<T, P>? resolve, GraphQLSubscriptionFieldResolver<T>? subscribe, String? deprecationReason, String? description, FieldDefinitionNode? astNode, GraphQLAttachments attachments = const []}) GraphQLObjectField<T, Serialized, P>
Shorthand for generating a GraphQLObjectField.
getDirectivesFromAttachments(GraphQLAttachments attachments) Iterable<DirectiveNode>
getDirectivesFromElement(GraphQLElement element) Iterable<DirectiveNode>
Returns the directives applied to a given GraphQL element
getType<T>() Type
Returns the type passed as type argument
inputField<T, Serialized>(String name, GraphQLType<T, Serialized> type, {String? description, T? defaultValue, String? deprecationReason, bool defaultsToNull = false, InputValueDefinitionNode? astNode, GraphQLAttachments attachments = const []}) GraphQLFieldInput<T, Serialized>
Shorthand for generating a GraphQLFieldInput.
inputObjectType<T>(String name, {String? description, Iterable<GraphQLFieldInput> fields = const [], T customDeserialize(Map<String, Object?>)?, bool isOneOf = false, GraphQLTypeDefinitionExtra<InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode> extra = const GraphQLTypeDefinitionExtra.attach([])}) GraphQLInputObjectType<T>
Shorthand for generating a GraphQLInputObjectType.
isSpecifiedDirective(GraphQLDirective directive) bool
Whether the directive is one of the default GraphQLDirective.specifiedDirectives
isSpecifiedScalarType(GraphQLType type) bool
Whether type is one of the default GraphQLScalarType types
listOf<Value, Serialized>(GraphQLType<Value, Serialized> innerType) GraphQLListType<Value?, Serialized>
Shorthand to create a GraphQLListType.
objectType<P>(String name, {String? description, bool isInterface = false, Iterable<GraphQLObjectField<Object?, Object?, P>> fields = const [], ResolveType<GraphQLObjectType<P>>? resolveType, IsTypeOf<P>? isTypeOf, Iterable<GraphQLObjectType> interfaces = const [], GraphQLTypeDefinitionExtra<TypeDefinitionNode, TypeExtensionNode> extra = const GraphQLTypeDefinitionExtra.attach([])}) GraphQLObjectType<P>
Shorthand for generating a GraphQLObjectType.
validateSchema(GraphQLSchema schema) List<GraphQLError>
Implements the "Type Validation" sub-sections of the specification's "Type System" section.

Typedefs

GraphQLAttachments = List<Object>
A Collection of extra or custom values associated with a GraphQLElement.
GraphQLClass = GraphQLObject
A typedef for GraphQLObject. You should use GraphQLObject instead. It was renamed, however it has the same functionality.
GraphQLFieldResolver<Value, P> = FutureOr<Value?> Function(P parent, Ctx<P> ctx)
Typedef for a function that resolves the value of a GraphQLObjectField, whether asynchronously or not.
GraphQLSubscriptionFieldResolver<Value> = FutureOr<Stream<Value?>> Function(Object? parent, Ctx ctx)
Typedef for a function that resolves the Stream of Values of a GraphQLObjectField, whether asynchronously or not.
IsTypeOf<P> = bool Function(Object result, GraphQLObjectType<P> type, ObjectExecutionCtx)
A function that returns true if result is an instance of GraphQLObjectType type
ResolveType<P extends GraphQLType<Object?, Object?>> = String Function(Object result, P type, ObjectExecutionCtx)
A function that returns the name of one of the possible types of an given abstract type that matches the type for result.

Exceptions / Errors

ErrorExtensions
GraphQLError
An error that may occur during the execution of a GraphQL query.
GraphQLException
An exception that occurs during execution of a GraphQL query.
InvalidTypeNameException
Thrown when a schema was constructed with a type with an invalid name
SameNameGraphQLTypeException
Thrown when a GraphQLSchema has at least two different GraphQLTypes with the same name.
SchemaValidationException
Base exception thrown on schema construction
UnnamedTypeException
Thrown when a schema was constructed with an unnamed type