Open Mozuha opened 1 year ago
Can you try in the last version?
@sibelius Do you mean v14.0.0? If so, the result did not change.
@sibelius I just noticed that the problem is not returning GraphQL scalar types. The real issue is that the relay compiler in my environment does not generate params.text for Query, although it does for Mutation. I tried with Mutation which returns Boolean and params.text was generated correctly. I have no clue why this happens yet but I wanted to let you know first.
@sibelius Okay, I found the reason. In my GraphQL schema, I put emailExists in the extended Query type:
extend type Query {
emailExists(email: String!): Boolean
}
Once I moved it into the original Query type definition, the relay compiler generated the correct params.text.
By the way, in the file generated with the extended Query type it was importing ClientRequest
from relay-runtime and assigned it as a type of node (const node: ClientRequest
), while in the file generated with the original Query type it was importing ConcreteRequest
and assigned it as a type of node (const node: ConcreteRequest
). And I cannot find ClientRequest in the type definition of relay-runtime.
I have the same problem, is there any way to fix it?
Given the query something like:
with schema:
running relay-compiler does not generate params.text but assigns null to it, so in the generated file, the return value of the node will be:
The example above is returning Boolean, but changing it to other GraphQL default scalar types (Int, Float, String, ID) resulted in the same behaviour.
Environment: