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

Insomnia cannot fetch GraphQL Schema - Error 400 #8309

Open
2 of 4 tasks
nZeus opened this issue Jan 21, 2025 · 1 comment
Open
2 of 4 tasks

Insomnia cannot fetch GraphQL Schema - Error 400 #8309

nZeus opened this issue Jan 21, 2025 · 1 comment
Labels
B-bug Bug: general classification S-unverified Status: Unverified by maintainer

Comments

@nZeus
Copy link

nZeus commented Jan 21, 2025

Expected Behavior

Insomnia cannot refresh the schema - it gets a 400 response:
Got status 400 fetching schema from https://local-domain/graphql

Image

But if I go to a browser, and type https://local-domain/graphql/schema.graphql in the incognito tab I get the schema with no issues.
So I wonder if I can get more details from Insomnia on what is going on? E.g. what exact URL is it trying to hit, does it add some special headers?

Actual Behavior

should load the schema

Reproduction Steps

Go to GraphQL and press "Refresh schema"

Is there an existing issue for this?

Which sync method do you use?

  • Git sync.
  • Insomnia Cloud sync.
  • Local only

Additional Information

Version: Insomnia 10.3.0
Build date: 12/20/2024
OS: Darwin arm64 24.2.0
Electron: 31.4.0
Node: 20.16.0
Node ABI: 125
V8: 12.6.228.30-electron.0
Architecture: arm64

Insomnia Version

10.3.0

What operating system are you using?

macOS

Operating System Version

OS: macos 24.2.0

Installation method

probably brew

Last Known Working Insomnia version

No response

@nZeus nZeus added B-bug Bug: general classification S-unverified Status: Unverified by maintainer labels Jan 21, 2025
@ryan-willis
Copy link
Contributor

The GraphQL schema is loaded using a schema introspection query. You can see our usage here. If the server does not have introspection enabled, Insomnia will fail to load it. The result of the schema loading attempt can be seen at the bottom of the request editor pane.

As an alternative, schemas can be imported from JSON files where the contents are the raw JSON result of an introspection query (i.e. there's a top-level data key).

There are external tools available that will transform GraphQL SDL (schema.graphql) into JSON: https://transform.tools/graphql-to-introspection-json but you'd have to nest that result into a top-level data key for Insomnia to recognize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: general classification S-unverified Status: Unverified by maintainer
Projects
None yet
Development

No branches or pull requests

2 participants