Skip to content

Allow disabling introspection queries #456

@bsmedberg-xometry

Description

@bsmedberg-xometry

Is your feature request related to a problem? Please describe.
I would like to avoid serving introspection in production builds of some services. I have a build pipeline that publishes the schema to an artifact at build time using juniper::introspect, so I really don't need the online schema to be available on my production services.

Describe the solution you'd like
I was looking for a way to disable introspection lookups on a RootNode, or filter introspection queries out at some layer of context, but I couldn't find an option to do that.

Describe alternatives you've considered
Haven't found an alternative yet.

Additional context
I'm happy to implement this but I'm not sure where to hang this. On the executor? That way in src/schema/schema.rs resolve_field, I could selectively resolve or fail depending on whether introspection was enabled or disabled on the executor, but would that involve passing in a new option to .execute(). Or does it makes sense to configure the root node with this flag?

Metadata

Metadata

Assignees

Labels

featureNew feature or requestk::apiRelated to API (application interface)k::securityRelated to security

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions