[GraphQL error]: Message: Malformed cursor, Location: [object Object], Path: product,metafields

[GraphQL error]: Message: Malformed cursor, Location: [object Object], Path: product,metafields

hiennq
Visitor
1 0 1

I have a code:

 

  query GetProductMetafields($productId: ID!, $namespace: String!, $numReviews: Int!, $fromCusor: String) {
    product(id: $productId) {
      id
      metafields(namespace: $namespace, first: $numReviews, after: $fromCusor) {
        pageInfo {
          hasNextPage
          hasPreviousPage
        }
        edges {
          cursor
          node {
            id
            key
            value
          }
        }
      }
    }
  }

 

 And main query  like this:

 

  const afterFetch = useQuery(GET_PRODUCT_METAFIELDS_QUERY, {
    variables: { productId, namespace, numReviews, fromCusor: from_cusor },
    fetchPolicy: "network-only",  
    notifyOnNetworkStatusChange: true,
  });

 

And i think "nothing wrong" because at a time, it returns results. Sometime it return error: [GraphQL error]: Message: Malformed cursor, Location: [object Object], Path: product,metafields

 

What i am wrong? Please tell me, it costs me 4 hours to fixed!

Replies 0 (0)