Unable to fetch GraphQL schema with Resource Owners Password Credentials OAuth 2 Authentication
Expected Behavior
GraphQL schemas are fetched successfully for authenticated requests.
Actual Behavior
This issue appears similar to #5661 but appears to be different.
On the current version of Insomnia (2023.4.0), regardless of if I use Automatic Fetch or manual refreshing, I am never able to successfully fetch my GraphQL schema for any requests, even though the request itself authenticates and executes with no issues. Here is what I see:
It is odd that the error box is blank. Other people in my organization can reproduce this same issue, but using other tools such as GraphiQL to inspect our GraphQL schema works just fine.
This used to work on a version of Insomnia from January 2023.
Reproduction Steps
- Setup a GraphQL request with Resource Owner Password Credentials OAuth 2 authentication
- Refresh the GraphQL schema.
Is there an existing issue for this?
- [X] I have searched the issue tracker for this problem.
Additional Information
Here is my authentication configuration:
Here is my Insomnia DevTools Console after clicking Refresh Schema:
Nothing appears in the DevTools Network tab.
Insomnia Version
2023.4.0
What operating system are you using?
macOS
Operating System Version
macOS Ventura 13.5
Installation method
download from insomnia.rest
Last Known Working Insomnia version
January 2023, can't remember specifically
Been dealing with this same issue!
I've tried with github's graphql api, using OAuth with grant type of Authorization Code. It works correctly.
Based on the screen shot of DevTools Console you provided, the introspection query has been sent sent successfully, which means that oauth access token is correct. So I think it's not an issue of OAuth.
I suspect that your graphql server can not respond to introspection query correctly. You can use our newest insomnia app to send following contents as a normal post request to your graphql server to see if your server can respond correctly. Notice that keep request's auth setting the same as before. The content blow is exactly how we fetch schema.
{"query":"\n query IntrospectionQuery {\n __schema {\n \n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n description\n \n locations\n args {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n description\n \n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n description\n type { ...TypeRef }\n defaultValue\n \n \n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n ","operationName":"IntrospectionQuery"}
Similar issue #3013