Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@graphiql/toolkit
Advanced tools
@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.
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);
The 'graphql' package is the core reference implementation of GraphQL for JavaScript. It provides the essential building blocks for creating GraphQL schemas and executing queries. While it doesn't offer the same level of integration with GraphiQL as @graphiql/toolkit, it is fundamental for any GraphQL-related development.
Apollo Server is a community-maintained open-source GraphQL server that works with any GraphQL schema. It provides a robust set of features for building a GraphQL API, including schema stitching, subscriptions, and more. Unlike @graphiql/toolkit, it focuses on server-side functionalities rather than client-side tools for GraphiQL.
The 'graphql-tools' package offers a set of utilities for building and manipulating GraphQL schemas. It includes features like schema stitching, schema transforms, and mock data generation. While it overlaps with some functionalities of @graphiql/toolkit, it is more focused on schema management and server-side utilities.
Changelog | API Docs | NPM | Discord
@graphiql/toolkit
This is a general purpose library for building GraphQL IDEs. It's being used by
other packages like graphiql
and @graphiql/react
and also provides utilities
that are useful when working with these packages.
createFetcher
: a utility for creating a
fetcher
prop implementation for HTTP GET, POST including multipart,
websockets fetcherFAQs
Utility to build a fetcher for GraphiQL
The npm package @graphiql/toolkit receives a total of 239,036 weekly downloads. As such, @graphiql/toolkit popularity was classified as popular.
We found that @graphiql/toolkit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.