insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

graphql documentation won't load

Open zdenkers opened this issue 1 year ago • 8 comments

Expected Behavior

after successful fetch of schema clicking show documentation loads the documentation view.

Actual Behavior

after clicking refresh schema and the request responding success, clicking show documentation doesn't load anything. additionally the view shows "schema not yet fetched" near the bottom still.

Reproduction Steps

  1. setup a valid graphql url in a graphql request.
  2. click refresh schema in the schema drop down.
  3. wait for request to successfully finish.
  4. click show documentation from the schema drop down.

Is there an existing issue for this?

Additional Information

No response

Insomnia Version

2022.7.5

What operating system are you using?

Windows

Operating System Version

windows 10

Installation method

downloaded from insomnia.rest

Last Known Working Insomnia version

not sure

zdenkers avatar Jan 25 '23 21:01 zdenkers

Hi @zdenkers thanks for reporting this.

If you go into View > Toggle Developer Tools, and then on the developer tools switch to the Console tab, do you notice any error logs when hitting refresh schema? If you do please share here.

filfreire avatar Jan 26 '23 08:01 filfreire

Hi @zdenkers thanks for reporting this.

If you go into View > Toggle Developer Tools, and then on the developer tools switch to the Console tab, do you notice any error logs when hitting refresh schema? If you do please share here.

No errors in the console or network tab. The console shows:

[network] Sending req=req_8de1369e8d194d718f0e1eafa4fda730.graphql env=null [network] Response succeeded req=req_8de1369e8d194d718f0e1eafa4fda730.graphql status=200

So it seems as if the request to fetch the schema is successful, which i am also seeing from my application. The request for the schema comes in, is successfully processed and returned to the requester. I've also double checked that its not just my application other production graphql apis schema also never loads.

zdenkers avatar Jan 27 '23 14:01 zdenkers

Just want to confirm that I too am experiencing this issue - I am unable to load the documentation view. There is no obvious error showing in the console or network tab... though strangely I see no network requests being made. The details of the application and system are:

Version: Insomnia 2022.7.5
Build date: 1/20/2023
OS: Darwin arm64 
Electron: 22.0.0
Node: 16.17.1
V8: 10.8.168.20-electron.0

chasevida avatar Jan 27 '23 21:01 chasevida

I have this problem as well. Steps to reproduce:

  1. Make new GraphQL request: POST https://api.github.com/graphql;
  2. Fill in some query for testing, e.g. query test{viewer{login}};
  3. Under “schema 🔧” UI drop-down, turn OFF “Automatic Fetch”;
  4. Restart Insomnia (to unload any previously cached schema);
  5. Under “schema 🔧” UI drop-down, choose “Refresh Schema”;
  6. ✅ Observe that the UI displays “fetching schema…” for a while;
  7. ✅ Observe that the JS console prints [network] Response succeeded req=req_<HASH>.graphql status=200;
  8. ❌ Observe that “fetching schema…” in the UI turned to “schema not yet fetched”;
  9. ❌ “Show Documentation” and Cmd-clicking identifiers in the GraphQL query does not work.

Expected:

  • “Refresh Schema” results in the fetched GraphQL schema being loaded into Insomnia;
  • “Show Documentation” shows the documentation based on the fetched GraphQL schema;
  • Cmd-clicking identifiers opens the associated documentation in the sidebar.

Workaround:

  • Turn ON “Automatic Fetch” under “schema 🔧”. This will cause the GraphQL schema to be re-fetched any time you switch views between different Insomnia requests, even if all the requests are GraphQL requests to an identical URL with identical HTTP headers, which I personally find slow and wasteful, but is a sufficient workaround for Insomnia not being able to display GraphQL docs at all.
Version: Insomnia 2022.7.5
Build date: 1/19/2023
OS: Darwin arm64 21.6.0
Electron: 22.0.0
Node: 16.17.1
V8: 10.8.168.20-electron.0
Architecture: arm64

mislav avatar Feb 06 '23 15:02 mislav

I can confirm I have the same issue. Automatic Fetch was able to load the schema, but not Refresh Schema.

Version: Insomnia 2022.7.5
Build date: 1/19/2023
OS: Darwin x64 22.3.0
Electron: 22.0.0
Node: 16.17.1
V8: 10.8.168.20-electron.0
Architecture: x64

relgames avatar Mar 12 '23 15:03 relgames

I can confirm I have the same issue as well. Unable to fetch schema by clicking "Refresh Schema". It does work when clicking "Automatic Fetch"

jpatricknola avatar Mar 14 '23 20:03 jpatricknola

@filfreire Any update on this? This is a really annoying bug that makes insomnia borderline useless for graphql development.

zdenkers avatar Apr 05 '23 15:04 zdenkers

A workaround for this is to restart Insomnia, after that the docs are updated. But that's quite bothersome, especially when making frequent schema changes.

eddex avatar Jul 05 '23 09:07 eddex