I'm using Apollo GraphQL but I'm new to it and I'm getting the following error:
{
"framesToPop": 1,
"name": "Invariant Violation"
}
Here is my code:
const httpLink = createHttpLink({
uri: "https://api.example.com/v3/ListingsQuery",
fetch
});
const automaticPersistedQueryLink = createPersistedQueryLink();
const apolloClient = new ApolloClient({
link: ApolloLink.from([automaticPersistedQueryLink, httpLink]),
cache: new InMemoryCache()
});
const variables = {
filters: {statuses: ["ACTIVE", "UNLISTED"]},
orderBys: [{sortField: "STATUS", sortOrder: "DESC"}],
shouldFetchHostMultiListingAgendaPermissions: true,
offset: 0,
shouldFetchListingPermissions: false,
count: 15,
query: null
};
await apolloClient.query({
query: {},
variables
});
Any idea what I'm doing wrong?