Skip to content

defaultTabs does not populate default tabs on GraphiQL #3979

@aryascripts

Description

@aryascripts

Describe the bug

When I visit the GraphQL Yoga playground (GraphiQL), I don't see the expected default query that I've set in the code.

const defaultQuery = /* GraphQL */ `
  query Hello {
    hello
  }
`;

const yoga = createYoga({
  graphiql: {
    defaultTabs: [{ query: defaultQuery }],
  },
  schema,
});

Minimal reproduction here: https://codesandbox.io/p/devbox/objective-david-f5h3zx?file=%2Fsrc%2Fmain.ts%3A6%2C28

Your Example Website or App

https://codesandbox.io/p/devbox/objective-david-f5h3zx?file=%2Fsrc%2Fmain.ts%3A6%2C28

Steps to Reproduce the Bug or Issue

  1. Example code from graphql yoga quick start is in the code sandbox linked above.
  2. yarn start
  3. Browse to http://localhost:5000/graphql
  4. Expected default tabs are missing

Expected behavior

As a user of GraphiQL, I expect that the default tabs get populated when I open GraphiQL.

Screenshots or Videos

Image

Platform

  • "graphql": "16.10.0",
  • "graphql-yoga": "5.13.3"
  • Node 23.x

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions