Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@graphiql/toolkit

Package Overview
Dependencies
Maintainers
0
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphiql/toolkit

Utility to build a fetcher for GraphiQL

  • 0.11.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
365K
increased by9.65%
Maintainers
0
Weekly downloads
 
Created

What is @graphiql/toolkit?

@graphiql/toolkit is a set of utilities and tools designed to help developers build and extend GraphiQL, a popular in-browser IDE for exploring GraphQL. It provides various functionalities to facilitate the creation of custom GraphiQL components and plugins.

What are @graphiql/toolkit's main functionalities?

GraphiQL Plugin Development

This feature allows developers to create custom fetchers for GraphiQL, enabling them to connect to different GraphQL endpoints. The code sample demonstrates how to create a fetcher and use it within a GraphiQL component.

const { createGraphiQLFetcher } = require('@graphiql/toolkit');

const fetcher = createGraphiQLFetcher({
  url: 'https://my-graphql-endpoint.com/graphql',
});

// Use the fetcher in a GraphiQL component
<GraphiQL fetcher={fetcher} />;

Schema Introspection

This feature provides utilities for schema introspection, allowing developers to fetch and explore the schema of a GraphQL endpoint. The code sample shows how to introspect a schema from a given endpoint.

const { introspectSchema } = require('@graphiql/toolkit');

async function getSchema() {
  const schema = await introspectSchema('https://my-graphql-endpoint.com/graphql');
  console.log(schema);
}

getSchema();

GraphQL Query Parsing

This feature includes tools for parsing GraphQL queries, which can be useful for analyzing and manipulating queries programmatically. The code sample demonstrates how to parse a GraphQL query string.

const { parse } = require('@graphiql/toolkit');

const query = `{
  user(id: "1") {
    name
    email
  }
}`;

const parsedQuery = parse(query);
console.log(parsedQuery);

Other packages similar to @graphiql/toolkit

Keywords

FAQs

Package last updated on 22 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc