Graphiql Install -
npm install graphql-playground-middleware-express Save as install-graphiql.sh :
app.listen(4000, () => console.log('Server running at http://localhost:4000/graphiql'); ); node server.js Access: http://localhost:4000/graphiql 3.2 Method 2: Apollo Server Integration Target: Apollo Server users (most modern setup). Installation: npm install @apollo/server graphql npm install @as-integrations/express Server Code: const express = require('express'); const ApolloServer = require('@apollo/server'); const expressMiddleware = require('@apollo/server/express4'); const typeDefs = #graphql type Query hello: String ; graphiql install
To install GraphQL Playground as an alternative: const ApolloServer = require('@apollo/server')