question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to disable introspection

See original GitHub issue

In Apollo server there is an option introspection: true to turn on and off graphql introspection. How to the same in GraphQL yoga?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

2reactions
performautodevcommented, Oct 21, 2021

You can done this by :

const NoIntrospection = require(“graphql-disable-introspection”);

server.start( { validationRules: [NoIntrospection], } );

export declare class GraphQLServer { … options: Options; … }

export interface Options extends ApolloServerOptions { port?: number | string; cors?: CorsOptions | false; … }

0reactions
saihajcommented, Feb 19, 2022

hey @iamchathu @omar-dulaimi we @the-guild-org are the new maintainers of this project. We are actively developing v2. It is build on top of envelop and in the new version you can just pass in the disable introspection plugin.

import { createServer } from '@graphql-yoga/node'
import { useDisableIntrospection } from '@envelop/disable-introspection'
const server = createServer({
  schema,
  logging: false,
  plugins: [useDisableIntrospection()]
})

Would love to get your feedback on beta release!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why and how to disable introspection query for GraphQL APIs
Why and how to disable introspection query for GraphQL APIs ... GraphQL schema by disabling introspection query which is enabled by default.
Read more >
graphql-disable-introspection - npm
Disable introspection queries in GraphQL with a simple validation rule. ... npm install -save graphql-disable-introspection.
Read more >
Disabling introspection - gqlgen
Disable introspection for the whole server. To opt out of introspection globally you should build your own server with only the features you...
Read more >
Disable GraphQL Introspection in graphql-java-tools
If you are using graphql-spring-boot, according to the graphql-java-tools README, you can disable the introspection query by setting the graphql ...
Read more >
Cloud Standard & EE: Disable GraphQL introspection - Hasura
The GraphQL engine by default enables GraphQL Schema Introspection which gives full information about the schema and may not be desired in production....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found