Title
t

theom

10/24/2018, 12:31 PM
So I'm getting an
You must wrap the query string in a "gql" tag.
error when calling refreshQueries. What am I overlooking here? pagination.js
const PAGINATION_QUERY = gql`
    query PAGINATION_QUERY {
        itemsConnection {
            aggregate {
                count
            }
        }
    }
`;

export { PAGINATION_QUERY };
createItem.js
import deleteItemsFromCache from '../utils/deleteItemsFromCache';
import PAGINATION_QUERY from './Pagination';

update = (cache, payload) => {
    deleteItemsFromCache
};

<Mutation 
    mutation={CREATE_ITEM_MUTATION} 
    variables={this.state}
    update={this.update}
    refetchQueries={[{ query: PAGINATION_QUERY }]}
>
a

Asjas

10/24/2018, 12:40 PM
You are using a named export but then you use a default import. Decide on one and then make them be the same. This should fix it. Use a named export and named import
export { PAGINATION_QUERY };
import { PAGINATION_QUERY } from './Pagination';
t

theom

10/24/2018, 12:53 PM
@Asjas Many thanks 👍