marmelab / react-admin

A frontend Framework for single-page applications on top of REST/GraphQL APIs, using TypeScript, React and Material Design
http://marmelab.com/react-admin
MIT License
24.8k stars 5.23k forks source link

ra-data-graphql saves rejected promise as introspection data #8097

Open dannyan2014 opened 2 years ago

dannyan2014 commented 2 years ago

If an initial introspection query fails, a rejected promise is kept and it is returned as a subsequent introspection query response.

What you were expecting: ra-data-graphql to refetch introspection schema on a subsequent try after failure.

What happened instead: ra-data-graphql keeps returning a rejected promise and introspection schema can't be fetched again until a browser refresh.

Steps to reproduce:

Related code: Inserting await in line 26 of introspection.ts solved the issue for us:

introspectionPromise = await runSchemaIntrospection(client, options);
bgdtc commented 1 year ago

same problem but inserting an await there didn't fix my problem