react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

[ra-data-graphql-simple] UNION types crash the query because the selectionSet doesnt include the union types

Open tdfairbrother opened this issue 6 years ago • 2 comments

What you were expecting: In the ra-data-graphql-simple package, it is creating an incomplete selectionSet when it finds a union type.

Steps to reproduce: Try hooking up to a graph with union types

Related code: I have managed to get past the error with the following filter in buildFields.

      if (type.kind === TypeKind.UNION) {
          return acc;
      }

I don't think it is useful trying to query union types when the guesser components wouldn't know how to render them. I would rather them be filtered out than cause a crash.

tdfairbrother avatar Feb 06 '20 05:02 tdfairbrother

Thank you for opening this issue. In order to confirm it, we'll have to reproduce it. As explained in the bug report template, please fork the following CodeSandbox and repeat your issue on it:

https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/simple

This is the simplest way to confirm a bug is related to the React Admin codebase.

Kmaschta avatar Apr 07 '20 08:04 Kmaschta

Without new information since 2 month, this issue is closed. Feel free to propose your fix or your reproducing examples if you're still experiencing an issue on it.

JulienMattiussi avatar Apr 17 '20 09:04 JulienMattiussi