Skip to content
Discussion options

You must be logged in to vote

It turns out "Mutation" should be "mutation_root" by looking at the schema. This is "Nhost" which uses Hasura.
The updater now looks something like this and prevents the query from making any network requests:

const client = createUrqlClient({
  url: nhost.graphql.url,
  exchanges: [
    cacheExchange({
      schema: schema as ReturnType<typeof minifyIntrospectionQuery>,
      updates: {
        mutation_root: {
          insert_items_one: (result, args, cache, info) => {
            cache.updateQuery({ query: SELECT_ITEMS_QUERY, variables: { teamKey: "ENG" } }, data => {
              if (!data) return null;
              return {
                ...data,
                items: [...data.…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mikeaustin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant