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
type Query {
Entity(id: Int!): Entity
}
type Entity {
id: Int!
}
I expect to be able to click on a row of a DataGrid displaying the list of Entity and seeing an Edit screen for Entity.
What happened instead:
We get an error Element does not exist and we a redirected to the list of Entity. The error message is incorrect, the real error is that the id variable is given as a string instead of a number.
Other information:
The issue is caused by the castType function (buildVariable.js:27). This function should cast the id variable to type string but it doesn't work with non nullable types.
In the castType function, we should check if the type's kind is NON_NULL, and in this case use type.ofType to discover the real type of the argument.
Environment
React-admin version: 3.9.2
Last version that did not exhibit the issue (if applicable):
React version: 16.13.1
Browser: Chrome
The text was updated successfully, but these errors were encountered:
What you were expecting:
given this schema simplified schema:
I expect to be able to click on a row of a DataGrid displaying the list of Entity and seeing an Edit screen for Entity.
What happened instead:
We get an error
Element does not exist
and we a redirected to the list of Entity. The error message is incorrect, the real error is that theid
variable is given as a string instead of a number.Other information:
The issue is caused by the
castType
function (buildVariable.js:27). This function should cast theid
variable to type string but it doesn't work with non nullable types.In the
castType
function, we should check if the type'skind
isNON_NULL
, and in this case usetype.ofType
to discover the real type of the argument.Environment
The text was updated successfully, but these errors were encountered: