🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

graphql-playground-middleware-express

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-playground-middleware-express

GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).

1.7.23
latest
100

Supply Chain Security

100

Vulnerability

73

Quality

83

Maintenance

100

License

Version published
Weekly downloads
219K
-3.71%
Maintainers
6
Weekly downloads
 
Created

What is graphql-playground-middleware-express?

The graphql-playground-middleware-express package provides middleware for integrating GraphQL Playground, an in-browser IDE for exploring GraphQL APIs, with Express.js applications. It allows developers to easily set up a user-friendly interface for testing and interacting with their GraphQL endpoints.

What are graphql-playground-middleware-express's main functionalities?

Setting up GraphQL Playground

This feature allows you to set up GraphQL Playground at a specific endpoint in your Express application. In this example, the playground is accessible at '/playground' and it points to the GraphQL endpoint '/graphql'.

const express = require('express');
const { express: playground } = require('graphql-playground-middleware-express');

const app = express();

app.get('/playground', playground({ endpoint: '/graphql' }));

app.listen(3000, () => {
  console.log('Server is running on http://localhost:3000');
});

Customizing GraphQL Playground

This feature allows you to customize the settings of GraphQL Playground. In this example, the editor theme is set to 'dark' and the cursor shape is set to 'line'.

const express = require('express');
const { express: playground } = require('graphql-playground-middleware-express');

const app = express();

app.get('/playground', playground({
  endpoint: '/graphql',
  settings: {
    'editor.theme': 'dark',
    'editor.cursorShape': 'line'
  }
}));

app.listen(3000, () => {
  console.log('Server is running on http://localhost:3000');
});

Other packages similar to graphql-playground-middleware-express

FAQs

Package last updated on 04 Nov 2021

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