Skip to main content
Module

x/bq-oak-graphql/graphql-tools/utils/index.ts>collectFields

A simple graphql middleware for oak deno framework.
Latest
function collectFields
import { collectFields } from "https://deno.land/x/bq-oak-graphql@v2.0/graphql-tools/utils/index.ts";

Given a selectionSet, adds all of the fields in that selection to the passed in map of fields, and returns it at the end.

CollectFields requires the "runtime type" of an object. For a field which returns an Interface or Union type, the "runtime type" will be the actual Object type returned by that field.

Parameters

runtimeType: any
selectionSet: any
fields: Record<string, Array<any>>
visitedFragmentNames: Record<string, boolean>

Returns

Record<string, Array<any>>