Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphql queries missmatch with backend #16

Closed
imorad87 opened this issue Apr 12, 2024 · 3 comments
Closed

Graphql queries missmatch with backend #16

imorad87 opened this issue Apr 12, 2024 · 3 comments

Comments

@imorad87
Copy link

imorad87 commented Apr 12, 2024

.env.local variables

COMMERCE_PROVIDER=@vercel/commerce-bagisto
BAGISTO_CURRENCY_CODE=USD
BAGISTO_STORE_ENDPOINT=http://localhost:8000/graphql

Graphql query

query getProductListing(
    $input: FilterProductListingInput
    $first: Int = 10
    $page: Int = 1
  ) {
    getProductListing(input: $input, first: $first, page: $page) {
      paginatorInfo {
        count
        currentPage
        lastPage
        total
      }
      data {
        ...productInfo
      }
    }
  }

Nextjs app is trying to fetch the above query but, fails because the FilterProductListingInput type doesn't have the same type name on the backend side. Below is the query declaration on the backend side

extend type Query {
  products(input: FilterProductsInput @builder(method: "Webkul\\GraphQLAPI\\Queries\\Admin\\Catalog\\Products\\FilterProducts")): [Product!] @paginate(type: "PAGINATOR", defaultCount: 10, model: "Webkul\\GraphQLAPI\\Models\\Catalog\\Product")
}

as you can see the backend query expects the input variable to be of type FilterProductsInput but the frontend is using FilterProductListingInput

Using Bagisto version: v2.0.0
nextjs-commerce version: latest

Screenshot 2024-04-12 at 9 06 22 PM

@VikasTiwari-Webkul
Copy link
Collaborator

Hi @imorad87

Thanks for raising concern.

Unfortunately, Bagisto Next Commerce is not compatible with Bagisto version: v2.0.0

The team is working on it soon we will deploy the Next Bagito Commerce 2.0

@imorad87
Copy link
Author

@VikasTiwari-Webkul thank you for your reply

@VikasTiwari-Webkul
Copy link
Collaborator

Bagisto Next Commerce - v2 is now released.

Which is compatible with Bagisto version: v2.0.0.

commit: bed1c02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants