Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apollo GraphQL doesn't use new variables after refetching! #2490

Closed
makamekm opened this issue Nov 6, 2017 · 4 comments
Closed

Apollo GraphQL doesn't use new variables after refetching! #2490

makamekm opened this issue Nov 6, 2017 · 4 comments
Assignees
Labels

Comments

@makamekm
Copy link

makamekm commented Nov 6, 2017

Again... GraphQL doesn't use new variables after refetching.

@graphql<Api.LoadLTorEqQuery, Api.LoadLTorEqQueryVariables, {
  dataProps: DataProps
} & any>(Api.QL.Main.LoadLTorEq, {
  props: ({ ownProps, data: { loading, loadLTorEq, refetch } }) => ({
    data: loadLTorEq,
    loadingData: loading,
    refetchData: refetch
  }),
  options: (props) => ({
    variables: {
      timestamp: props.dataProps.date.getTime(),
      limit: props.dataProps.limit,
      symbols: props.allCoins.slice(props.pagination.offset, props.pagination.limit + props.pagination.offset),
      timeframe: props.dataProps.timefame
    }
  }),
})

symbols are always the same.

This is a duplication of an issue: Issue

@msmfsd
Copy link

msmfsd commented Nov 8, 2017

Bump, here is what happens on v2 only:

1. turn server offline
2. component loads with error { loading: false, error: 'Error: Network error: Failed to fetch', myUser: undefined  }
3. turn server online and refetch
4. component loads data successfully but error is not cleared { loading: false, error: 'Error: Network error: Failed to fetch', myUser: { uuid: GJGHJ86876HUIIUH }  }

@jbaxleyiii jbaxleyiii added this to the Post 2.0 bugs milestone Nov 13, 2017
@jbaxleyiii
Copy link
Contributor

Thanks for the reproduction! I'll take a look!

@jbaxleyiii jbaxleyiii self-assigned this Nov 13, 2017
@ex3ndr
Copy link

ex3ndr commented Dec 4, 2017

I have some similar problem. If i will NOT provide some variable and then (in other query) remove it then graphql doesn't perform query.

Workaround by setting variable as null works well.

@hwillson
Copy link
Member

hwillson commented Jun 1, 2018

This sounds like the same problem as #2499, which was resolved in #3500, and released in apollo-client 2.3.2. Closing - thanks all!

@hwillson hwillson closed this as completed Jun 1, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants