Skip to content

feat: disable introspection except for root key #223

@coratgerl

Description

@coratgerl

Currently, we disable introspection for the GraphQL schema for all requests. However, we should only authorize the root key to make this query. This will be useful for the integrated Dashboard.

Here is the location of this code in Wabe: link.

Here is an example of the documentation that we should use:

const yoga = createYoga({
  graphiql: false,
  plugins: [
    useDisableIntrospection({
      isDisabled: request => request.headers.get('x-allow-introspection') !== 'secret-access-key'
    })
  ]
});

Documentation : https://the-guild.dev/graphql/yoga-server/docs/features/introspection

This feature should be covered with a test in this file : https://github.com/palixir/wabe/blob/main/packages/wabe/src/server/index.test.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions