Uso de directivas no graphql com erro

Estou fazendo algumas requisições graphql no meu front VTEX-io que estão me retornando esse erro:

string"Invalid GraphQL query. Multiple app dependencies have defined "products". To fix this ambiguity you can use the @context directive to specify the app you need this data from. Current apps that provide "products" are: vtex.search-graphql, vtex.catalog-graphql."

tentei colocar o @context conforme a documentação , mas não estou conseguindo, alguém sabe como resolver isso?

as tentativas que fiz:

query products($term: String!, $pageSize: Int!, $page: Int!) {
  products @context(provider: "vtex.catalog-graphql")(term: $term, pageSize: $pageSize, page: $page) {
    items {
      name
      isActive
      imageUrl
      skus {
        skuName
        id
      }
      ref,
      id
    }
  }
}
query products($term: String!, $pageSize: Int!, $page: Int!) {
  products @context(provider: "vtex.catalog-graphql", term: $term, pageSize: $pageSize, page: $page) {
    items {
      name
      isActive
      imageUrl
      skus {
        skuName
        id
      }
      ref,
      id
    }
  }
}

Tente assim:


query products($term: String!, $pageSize: Int!, $page: Int!) {
  products(term: $term, pageSize: $pageSize, page: $page) 
  @context(provider: "vtex.catalog-graphql") {
    items {
      name
      isActive
      imageUrl
      skus {
        skuName
        id
      }
      ref,
      id
    }
  }
}

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.