FSharp.Data.GraphQL


Define

Namespace: FSharp.Data.GraphQL.Types
Parent Module: SchemaDefinitions

Common space for all definition helper methods.

Static members

Static memberDescription
AsyncField(...)
Signature: (name:string * typedef:'?8763 * description:string * args:InputFieldDef list * resolve:Expr<(ResolveFieldContext -> 'Val -> Async<'Res>)> * deprecationReason:string) -> FieldDef<'Val>
Type parameters: '?8763, 'Res, 'Val

Creates field defined inside object type with asynchronously resolved value. Fields is marked as deprecated.

AsyncField(...)
Signature: (name:string * typedef:'?8759 * description:string * args:InputFieldDef list * resolve:Expr<(ResolveFieldContext -> 'Val -> Async<'Res>)>) -> FieldDef<'Val>
Type parameters: '?8759, 'Res, 'Val

Creates field defined inside object type with asynchronously resolved value.

AsyncField(...)
Signature: (name:string * typedef:'?8755 * description:string * resolve:Expr<(ResolveFieldContext -> 'Val -> Async<'Res>)>) -> FieldDef<'Val>
Type parameters: '?8755, 'Res, 'Val

Creates field defined inside object type with asynchronously resolved value.

AsyncField(name, typedef, resolve)
Signature: (name:string * typedef:'?8751 * resolve:Expr<(ResolveFieldContext -> 'Val -> Async<'Res>)>) -> FieldDef<'Val>
Type parameters: '?8751, 'Res, 'Val

Creates field defined inside object type with asynchronously resolved value.

AutoField(...)
Signature: (name:string * typedef:'?8727 * description:string option * args:InputFieldDef list option * deprecationReason:string option) -> FieldDef<'Val>
Type parameters: '?8727, 'Res, 'Val

Creates field defined inside object types with automatically generated field resolve function. Field name must match object's property or field.

Enum(name, options, description)
Signature: (name:string * options:EnumValue<'Val> list * description:string option) -> EnumDef<'Val>
Type parameters: 'Val

Creates GraphQL type definition for user defined enums.

EnumValue(...)
Signature: (name:string * value:'Val * description:string option * deprecationReason:string option) -> EnumValue<'Val>
Type parameters: 'Val

Creates a single enum option to be used as argument in .

Field(...)
Signature: (name:string * typedef:'?8747 * description:string * args:InputFieldDef list * resolve:Expr<(ResolveFieldContext -> 'Val -> 'Res)> * deprecationReason:string) -> FieldDef<'Val>
Type parameters: '?8747, 'Res, 'Val

Creates field defined inside object type. Fields is marked as deprecated.

Field(...)
Signature: (name:string * typedef:'a * description:string * args:InputFieldDef list * resolve:Expr<(ResolveFieldContext -> 'Val -> 'Res)>) -> FieldDef<'Val>
Type parameters: 'a, 'Res, 'Val

Creates field defined inside object type.

Field(...)
Signature: (name:string * typedef:'a * description:string * resolve:Expr<(ResolveFieldContext -> 'Val -> 'Res)>) -> FieldDef<'Val>
Type parameters: 'a, 'Res, 'Val

Creates field defined inside object type.

Field(name, typedef, resolve)
Signature: (name:string * typedef:'a * resolve:Expr<(ResolveFieldContext -> 'Val -> 'Res)>) -> FieldDef<'Val>
Type parameters: 'a, 'Res, 'Val

Creates field defined inside object type.

Field(name, typedef)
Signature: (name:string * typedef:'?8731) -> FieldDef<'Val>
Type parameters: '?8731, 'Res, 'Val

Creates field defined inside interfaces. When used for objects may cause runtime exceptions due to lack of resolve function supplied. To use auto generated resolvers use .

Input(...)
Signature: (name:string * typedef:'a * defaultValue:'In option * description:string option) -> InputFieldDef
Type parameters: 'a, 'In

Creates an input field. Input fields are used like ordinary fileds in case of s, and can be used to define arguments to objects and interfaces fields.

InputObject(name, fields, description)
Signature: (name:string * fields:InputFieldDef list * description:string option) -> InputObjectDefinition<'Out>
Type parameters: 'Out

Creates a custom GraphQL input object type. Unlike GraphQL objects, input objects are valid input types, that can be included in GraphQL query strings. Input object maps to a .NET type, which can be strandard .NET class or struct, or a F# record.

InputObject(name, fieldsFn, description)
Signature: (name:string * fieldsFn:(unit -> InputFieldDef list) * description:string option) -> InputObjectDefinition<'Out>
Type parameters: 'Out

Creates a custom GraphQL input object type. Unlike GraphQL objects, input objects are valid input types, that can be included in GraphQL query strings. Input object maps to a .NET type, which can be strandard .NET class or struct, or a F# record.

Interface(...)
Signature: (name:string * fields:FieldDef<'Val> list * description:string option * resolveType:(obj -> ObjectDef) option) -> InterfaceDef<'Val>
Type parameters: 'Val

Creates a custom GraphQL interface type. It's needs to be implemented by object types and should not be used alone.

Interface(...)
Signature: (name:string * fieldsFn:(unit -> FieldDef<'Val> list) * description:string option * resolveType:(obj -> ObjectDef) option) -> InterfaceDef<'Val>
Type parameters: 'Val

Creates a custom GraphQL interface type. It's needs to be implemented by object types and should not be used alone.

Object(...)
Signature: (name:string * fields:FieldDef<'Val> list * description:string option * interfaces:InterfaceDef list option * isTypeOf:(obj -> bool) option) -> ObjectDef<'Val>
Type parameters: 'Val

Creates GraphQL custom output object type. It can be used as a valid output but not an input object (see for more details).

Object(...)
Signature: (name:string * fieldsFn:(unit -> FieldDef<'Val> list) * description:string option * interfaces:InterfaceDef list option * isTypeOf:(obj -> bool) option) -> ObjectDef<'Val>
Type parameters: 'Val

Creates GraphQL custom output object type. It can be used as a valid output but not an input object (see for more details).

Scalar(...)
Signature: (name:string * coerceInput:(Value -> 'T option) * coerceValue:(obj -> 'T option) * description:string option) -> ScalarDefinition<'T>
Type parameters: 'T

Creates GraphQL type definition for user defined scalars.

Union(...)
Signature: (name:string * options:ObjectDef list * resolveValue:('In -> 'Out) * resolveType:('In -> ObjectDef) option * description:string option) -> UnionDef<'In>
Type parameters: 'In, 'Out

Creates a custom GraphQL union type, materialized as one of the types defined. It can be used as interface/object type field. In order to work with F# discriminated unions, function may be used to unwrap objects nested as discriminated union cases.

Fork me on GitHub