Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Refetch or re-using lazy query make data incomplete. #4017

Open
t0mpl opened this issue Jun 10, 2020 · 0 comments
Open

Refetch or re-using lazy query make data incomplete. #4017

t0mpl opened this issue Jun 10, 2020 · 0 comments

Comments

@t0mpl
Copy link

t0mpl commented Jun 10, 2020

Hi everyone,

BUG: When I refetch (or re-use a lazy query a second time), a nested array is correctly returned by the server but does not appear in the data variable, which gives me an empty array.

schema of my request
`const questionFragment = gql'
fragment Question_question on Question {
id,
category,
type,
label,
required,
dateCreated,
options {
position,
id,
label
}
}
';

const questionSetFragment = gql'
fragment QuestionSet_questionSet on QuestionSet {
category,
dateCreated,
questions {
position,
questionId,
status
},
}
';

export const LIST_QUESTIONS_BY_CATEGORY = gql'
query listQuestionsByCategory($category: String, $limit: Int, $from: String) {
questionsByCategory(category: $category, filterDisabled: false, limit: $limit, from: $from) {
questions {
...Question_question
}
}
questionSet(category: $category) {
...QuestionSet_questionSet
}
}
${questionFragment}
${questionSetFragment}
';`

this part
questions { position, questionId, status },

is empty even through the array has data in the http response.

Version
I use React-apollo 3.1.5, i tried to downgrade to 3.1.4 but it's still the same.

Any help would be welcome :)
have a good day

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant