You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What you were expecting:
I would expect introspection not to crash, because inspecting the network request shows that there is in fact a valid schema returned by the server.
What happened instead:
the graphql introspection query throws an error:
Uncaught (in promise) TypeError: Cannot read property '__schema' of null
at introspection.js:76
Steps to reproduce:
Run a Prisma server which returns a valid response to introspection at localhost:4466
Other information:
A bit of investigation from my end points in the direction of fetchPolicy in apollo client. React-admin already sets fetchPolicy: 'network-only' for ordinary graphql queries, (which I figure is a fix for this exact problem) but not for the introspection. A related apollo-client issue is apollographql/apollo-client#3030, but it appears it has never been properly fixed. I suggest setting fetchPolicy: 'network-only' to the introspection query also to work around this bug in apollo-client.
Environment
React-admin version: 2.3.3
Last version that did not exhibit the issue (if applicable):
React version: 16.4.14
Browser: any Chrome/Firefox
Stack trace (in case of a JS error):
The crashing code in is in packages/ra-data-graphql/src/introspection.js:
Using
ra-data-opencrud
(https://github.com/Weakky/ra-data-opencrud) which again usesintrospection.js
inra-data-graphql
:What you were expecting:
I would expect introspection not to crash, because inspecting the network request shows that there is in fact a valid schema returned by the server.
What happened instead:
the graphql introspection query throws an error:
Steps to reproduce:
localhost:4466
Related code:
Other information:
A bit of investigation from my end points in the direction of
fetchPolicy
in apollo client. React-admin already setsfetchPolicy: 'network-only'
for ordinary graphql queries, (which I figure is a fix for this exact problem) but not for the introspection. A related apollo-client issue is apollographql/apollo-client#3030, but it appears it has never been properly fixed. I suggest settingfetchPolicy: 'network-only'
to the introspection query also to work around this bug in apollo-client.Environment
The crashing code in is in
packages/ra-data-graphql/src/introspection.js
:The text was updated successfully, but these errors were encountered: