Skip to content

defaultTabs does not populate default tabs on GraphiQL #3979

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

Open
aryascripts opened this issue Apr 9, 2025 · 1 comment
Open

defaultTabs does not populate default tabs on GraphiQL #3979

aryascripts opened this issue Apr 9, 2025 · 1 comment

Comments

@aryascripts
Copy link
Contributor

aryascripts commented Apr 9, 2025

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

@aryascripts

This comment has been minimized.

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

1 participant