Closed johannesmutter closed 3 years ago
I just noticed how the query method for client is written has changed, which caused above error:
wrong:
const book = query(client, {
query: getBook,
variables: {uuid}
});
correct:
const card = query(getBook, {
variables: {uuid}
});
or:
const card = client.query(getBook, {
variables: {uuid}
});
After updating svelte-apollo to 4.0.0 I get this error:
Uncaught (in promise) Invariant Violation: Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag?
I changed the import for ApolloClient. Because the import as specified in the examples of "Readme" causes this error:
This is the simpliefied code that creates above error. In svelte-apollo.js:
In app.svelte:
In book.svelte:
package.json:
I tried many different variations of the query, with and without variables but the error persists. Can you maybe share a full example with the code for gql
...
?Thank you