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

How to disable introspection? And feature request for manually adding authentication headers. #649

Open
Aravind1411 opened this issue Oct 3, 2022 · 1 comment

Comments

@Aravind1411
Copy link

Aravind1411 commented Oct 3, 2022

I've seen a closed issue regarding disabling introspection in grahql playground. As the solution was deleted, still not clear how to disable introspection in golang. Basically I just wanna see the schema and not run the query. How can I achieve this?

@jesko-plitt
Copy link

You can disable schema introspection:

graphql.SchemaMetaFieldDef.Resolve = func(p graphql.ResolveParams) (interface{}, error) {
    return graphql.Schema{}, nil
}

And you can re-enable it, too:

graphql.SchemaMetaFieldDef.Resolve = func(p ResolveParams) (interface{}, error) {
    return p.Info.Schema, nil
}

Feels a bit hacky though...

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

2 participants