Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring introspection on/off via .meshrc.yml file #3433

Open
iamcdonald opened this issue Jan 6, 2022 · 2 comments
Open

Configuring introspection on/off via .meshrc.yml file #3433

iamcdonald opened this issue Jan 6, 2022 · 2 comments

Comments

@iamcdonald
Copy link

iamcdonald commented Jan 6, 2022

Is your feature request related to a problem? Please describe.
Disabling GraphQL introspection.
We'd currently like to be able to run graphql-mesh with introspection on/off based on context/environment.
Having looked through it would appear this is possible via graphql-helix (as outlined here) but isn't exposed through graphql-mesh (validationRules isn't passed here).

Describe the solution you'd like
Be able to pass configure introspection on/off via the .meshrc.yml file.

Describe alternatives you've considered
The one thing I've spotted is the ability to point introspection at a JSON file via config. I guessing this could be an empty JSON file(?) but it seems like a work-around. However, this doesn't seem to be available with grpc sources/I'm finding it a bit hard to decipher where exactly it would need to be present within the .meshrc.yml file from the documentation.

Hopefully I'm not missing something obvious.

Thanks

@alanwillms
Copy link

It would be nice if I could configure a custom function to decide whether the introspection can or cannot be done. For example, my function could check if the user sent a specific authorization token, etc.

@Urigo Urigo mentioned this issue Aug 11, 2022
22 tasks
@robertrosman
Copy link

I second that an introspection configuration option would be really nice!

For the time being I managed to disable it with @envelop/disable-introspection. Here's my setup:

// lib/plugins/index.ts
import { Plugin } from '@envelop/core'
import { useDisableIntrospection } from '@envelop/disable-introspection'
 
const plugins: Plugin[] = [
    useDisableIntrospection()
]
 
export default plugins
# .meshrc.yml
serve:
  playground: false # Ideally we would look at node_env or environment variable to set this to true for non-prod, and true for prod

additionalEnvelopPlugins: './lib/plugins/index.ts'

I haven't yet solved how to pass in a boolean environment variable to playground, since env variables are always strings.

This was referenced Apr 30, 2024
This was referenced May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants