Skip to content

Commit 3e1b46e

Browse files
sgtfrankieboyGuillaume Chau
authored andcommitted
Added info on prefetch/variables mismatch (#113)
Added a short description to the readme telling people that the `prefetch` and `variables` options need to match or the query result will not be populated while rendering server-side.
1 parent 65f9088 commit 3e1b46e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,8 @@ On the queries you want to prefetch on the server, add the `prefetch` option. It
11531153
- a variables object,
11541154
- a function that gets the context object (which can contain the URL for example) and return a variables object,
11551155
- `true` (query's `variables` is reused).
1156+
1157+
If you are returning a variables object in the `prefetch` option make sure it matches with the result of the `variables` option. If they do not match the query's data property will not be populated while rendering the template server-side.
11561158

11571159
**Warning! You don't have access to the component instance when doing prefetching on the server. Don't use `this` in `prefetch`!**
11581160

0 commit comments

Comments
 (0)