This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
Component created with graphql() does not update query variables when props change #1873
Labels
has-reproduction
❤ Has a reproduction in a codesandbox or single minimal repository
Intended outcome:
When create react component using
GraphQLComponent = graphql(query, options)(MyComponent)
it is expected that we can pass query variable viaGraphQLComponent
's props and but I found a bug that when that props change the graphql query isn't got updated. You can take a look at theQuery
component in the picture below.Actual outcome:
The graphql query isn't updated according to the props change.
How to reproduce the issue:
I created a repo to reproduce a code here.
Version
I believe this line cause the bug. It eventually sets
operationOptions.options.variables
and cause the subsequence render thing that we already pass the variables from the beginning. Because of this we have to pass a non empty option to the graphql function to reproduce the issue. In my case I used this:The text was updated successfully, but these errors were encountered: