FSharp.Data.GraphQL


Linq

Namespace: FSharp.Data.GraphQL

The MIT License (MIT) Copyright (c) 2016 Bazinga Technologies Inc

Nested types and modules

TypeDescription
Arg

Record defining an argument resolved as part of the property tracker.

ArgApplication

Delegate describing application of the callable argument on the provided LINQ expression.

CallableArg

Input for custom argument applicators. Contains metadata associated with current property call.

Track

A track is used to represend a single member access statement in F# quotation expressions. It can be represented as (member: from -> to), where member in name of field/property getter, from determines a type, which member is accessed and to a returned type of a member.

Tracker

A representation of the property tree - describes a tree of all properties and subproperties accessed in provided ExecutionInfo with top level argument given as a root.

Functions and values

Function or valueDescription
tracker vars info
Signature: vars:Map<string,obj> -> info:ExecutionInfo -> Tracker

Creates an intermediate representation of ExecutionInfo by traversing all F# quotations provided in field definition resolvers in order to catch all member accesses (fields / property getters) and tries to construct a dependency tree from them with root starting from query root object parameter.

This is a fast and naive way to resolve all properties that are possibily accessed in resolver functions to include them inside LINQ query constructed later - this way we can potentially omit multiple database calls as a result of underfetched data.

NOTE: This technique doesn't track exact properties accessed from the root and can can cause eager overfetching.

Type extensions

Type extensionDescription
Apply(info, ?variables, ?applicators)
Signature: (info:ExecutionInfo * variables:Map<string,obj> option * applicators:Map<string,ArgApplication> option) -> IQueryable<'T>

Replaces top level type of the execution info with provided queryable source and constructs a LINQ expression from it, returing queryable with all applied operations as the result.

By default, GraphQL may define queries that will be interpreted in terms of LINQ operations, such as orderBy, orderByDesc, skip, take, but also more advanced like: -idreturning where comparison with object's id field.-first/afterreturning slice of the collection, ordered by id with id greater than provided in after param.-last/before` returning slice of the collection, ordered by id descending with id less than provided in after param.

CompiledName: IQueryable`1.Apply

Fork me on GitHub