if `componentA` loads a query like this: `<Quer...
# orm-help
j
if
componentA
loads a query like this:
<Query query={EVENT_QUERY} variables={{ slug: this.props.match.params.slug }}>
with the following qgl:
Copy code
export const EVENT_QUERY = gql`
  query EventQuery($slug: String!) {
    event(slug: $slug) {
      id
      slug
      description
      title
      dates {
        id
        timestamp
      }
      places {
        id
        name
        url
      }
      participants {
        id
        name
      }
      menus
    }
  }
`;
And then I pass
participants
to
componentB
What if
componentC
makes a
create mutation
and adds a new
participant
to that event... How should I update the original query so that the changes with cascade down to components A and B?
Would it be something like this in the <Mutation>?
Copy code
update={(cache, { data }) => {
            const { event } = cache.readQuery({ query: EVENT_QUERY });
            cache.writeQuery({
              query: EVENT_QUERY,
              data: { participants: event.concat([data.createParticipant]) },
            });
          }}
h
Yes, you will require to update the cache manually. Also, I think apollo's slack would be a better place to ask this
👍 1