Modules@robinpath/graphql

@robinpath/graphql

0.1.0Public

GraphQL client with queries, mutations, variables, and introspection

@robinpath/graphql

GraphQL client with queries, mutations, variables, introspection, batch requests, and query builder

Category Functions Auth License

Why use this module?

The graphql module lets you:

  • Create a named GraphQL client
  • Execute a GraphQL query
  • Execute a GraphQL mutation
  • Send a one-off GraphQL request without creating a client
  • Run an introspection query to discover the schema

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/graphql

Quick Start

No credentials needed — start using it right away:

graphql.query "github" "{ viewer { login name } }"

Available Functions

FunctionDescription
graphql.createCreate a named GraphQL client
graphql.queryExecute a GraphQL query
graphql.mutateExecute a GraphQL mutation
graphql.rawRequestSend a one-off GraphQL request without creating a client
graphql.introspectRun an introspection query to discover the schema
graphql.listTypesList all types in the GraphQL schema
graphql.buildQueryBuild a simple GraphQL query string from parts
graphql.batchQueryExecute multiple queries sequentially
graphql.destroyRemove a GraphQL client

Examples

Execute a GraphQL query

graphql.query "github" "{ viewer { login name } }"

Execute a GraphQL mutation

graphql.mutate "api" "mutation { createUser(name: $name) { id } }" {"name": "Alice"}

Send a one-off GraphQL request without creating a client

graphql.rawRequest "https://api.example.com/graphql" "{ users { id } }"

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/graphql";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  graphql.query "github" "{ viewer { login name } }"
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/graphql
Version0.1.0
LicenseMIT
Unpacked Size5.3 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

web