graphql-anywhere

  • Version 4.2.7
  • Published
  • 168 kB
  • 3 dependencies
  • MIT license

Install

npm i graphql-anywhere
yarn add graphql-anywhere
pnpm add graphql-anywhere

Overview

Run GraphQL queries with no schema and just one resolver

Index

Functions

function check

check: (doc: DocumentNode, data: any, variables?: VariableMap) => void;

    function filter

    filter: <FD = any, D extends FD = any>(
    doc: DocumentNode,
    data: D,
    variableValues?: VariableMap
    ) => FD;

      function graphql

      graphql: (
      resolver: Resolver,
      document: DocumentNode,
      rootValue?: any,
      contextValue?: any,
      variableValues?: VariableMap,
      execOptions?: ExecOptions
      ) => any;

        function propType

        propType: (doc: DocumentNode, mapPropsToVariables?: (props: any) => any) => any;

          Type Aliases

          type ExecContext

          type ExecContext = {
          fragmentMap: FragmentMap;
          contextValue: any;
          variableValues: VariableMap;
          resultMapper: ResultMapper;
          resolver: Resolver;
          fragmentMatcher: FragmentMatcher;
          };

            type ExecInfo

            type ExecInfo = {
            isLeaf: boolean;
            resultKey: string;
            directives: DirectiveInfo;
            field: FieldNode;
            };

              type ExecOptions

              type ExecOptions = {
              resultMapper?: ResultMapper;
              fragmentMatcher?: FragmentMatcher;
              };

                type FragmentMatcher

                type FragmentMatcher = (
                rootValue: any,
                typeCondition: string,
                context: any
                ) => boolean;

                  type Resolver

                  type Resolver = (
                  fieldName: string,
                  rootValue: any,
                  args: any,
                  context: any,
                  info: ExecInfo
                  ) => any;

                    type ResultMapper

                    type ResultMapper = (
                    values: {
                    [fieldName: string]: any;
                    },
                    rootValue: any
                    ) => any;

                      type VariableMap

                      type VariableMap = {
                      [name: string]: any;
                      };

                        Package Files (3)

                        Dependencies (3)

                        Dev Dependencies (0)

                        No dev dependencies.

                        Peer Dependencies (1)

                        Badge

                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/graphql-anywhere.

                        • Markdown
                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/graphql-anywhere)
                        • HTML
                          <a href="https://www.jsdocs.io/package/graphql-anywhere"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>