Socket
Socket
Sign inDemoInstall

graphql-config

Package Overview
Dependencies
113
Maintainers
4
Versions
316
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-config

The easiest way to configure your development environment with your GraphQL schema (supported by most tools, editors & IDEs)


Version published
Maintainers
4
Weekly downloads
3,305,410
decreased by-4.4%

Weekly downloads

Package description

What is graphql-config?

The graphql-config npm package provides a set of utilities to make it easier to configure and use GraphQL in your development environment. It allows for the centralization of GraphQL project configurations, making it simpler to share settings across different tools such as IDEs, GraphQL clients, and other utilities that work with GraphQL.

What are graphql-config's main functionalities?

Loading GraphQL Project Configuration

This feature allows you to load the GraphQL project configuration. The `loadConfig` function asynchronously loads the configuration from the default or specified configuration file.

const { loadConfig } = require('graphql-config');

async function main() {
  const config = await loadConfig();
  console.log(config);
}

main();

Getting Schema Information

This feature enables you to retrieve the GraphQL schema information from the configuration. It's useful for tools and applications that need to introspect the schema.

const { loadConfig } = require('graphql-config');

async function main() {
  const config = await loadConfig();
  const schema = await config.getDefault().getSchema();
  console.log(schema);
}

main();

Working with Endpoints

This feature allows for the management of GraphQL API endpoints within the configuration. It simplifies the process of switching between different environments or API versions.

const { loadConfig } = require('graphql-config');

async function main() {
  const config = await loadConfig();
  const endpoint = config.getDefault().endpoint('default');
  console.log(endpoint);
}

main();

Other packages similar to graphql-config

Readme

Source

GraphQL Conf 2023

GraphQL Config npm version code style: prettier renovate-app badge Discord Chat

GraphQL Config - one configuration for all your GraphQL tools (supported by most tools, editors & IDEs). The easiest way to configure your development environment with your GraphQL Schema.

As a developer, you gain simplicity and a central place to setup libraries, tools and your IDE extensions.

As a library author GraphQL Config makes it easier to maintain the code responsible for handling configuration, loading GraphQL schemas or even files with GraphQL operations and fragments. GraphQL Config provides a set of useful methods and an easy-to-work-with API.

Example

schema: ./schema.json
documents: ./src/components/**/*.jsx

Installation and Usage

Visit our website graphql-config.com to learn more about the GraphQL Config.

Help & Community

Join our Discord chat if you run into issues or have questions. We love talking to you!

Contributions

Contributions, issues and feature requests are very welcome. If you are using this package and fixed a bug for yourself, please consider submitting a PR!

And if this is your first time contributing to this project, please do read our Contributor Workflow Guide before you get started off.

Code of Conduct

Help us keep GraphQL Config open and inclusive. Please read and follow our Code of Conduct as adopted from Contributor Covenant

License

GitHub license

MIT

Keywords

FAQs

Last updated on 08 Oct 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc