Questions tagged [graphql]

Denotes questions about Magento GraphQL.

Filter by
Sorted by
Tagged with
0 votes
1 answer
980 views

How to Get all Order using GraphQL in Magento 2?

I want to get all Pending order Status Orders using GraphQL, Anyone can share a complete example or module. How to I'll do that ? I have create Custom module Admin Grid, Now i want to display Only ...
Wajahat Bashir's user avatar
0 votes
1 answer
159 views

How to install PWA in Magento 2.4.4 in windows

I need to install PWA (Progressive Web Apps) in Magento 2.4.4. so can anyone have an idea about it,then please share with me. Thank you.
Deep Shah's user avatar
  • 541
1 vote
1 answer
318 views

Magento 2 : How to correctly return 401 unauthroized in graphql request

Existing Magento GraphQLExceptions return 200-th http code. What would be a correct way to throw 401 for example? Or at least show custom status code in response.
Herokiller's user avatar
1 vote
1 answer
655 views

Return custom db fields via graphql resolvers

I've added custom fields to sales_order Now I want to return them in customerOrders GraphQL query as a value from database. How can I do it without fetching the order from database again in Resolver ...
Herokiller's user avatar
1 vote
1 answer
2k views

Magento 2 GraphQL add product with additional option to cart

i want to add product to cart with additional option using GraphQL, i am using below mutation to add product to cart mutation { addSimpleProductsToCart( input: { cart_id: "{{cart_id}}&...
Jigs Parmar's user avatar
  • 2,523
0 votes
1 answer
191 views

How to get the name of the respective mutation or query which calls the resolver

I have two mutation which maps to same resolver class. I need to differentiate between both mutations. So in-order to do that, I am looking for a functionality to fetch the name of the mutation or ...
JDhere's user avatar
  • 15
1 vote
0 answers
168 views

Magento 2 graphql integration with Hosted(Redirect) Payment method

i want to create graphql api for custom Hosted(Redirect) payment method. can anyone elaborate step how can i create that for payment method?
Jigs Parmar's user avatar
  • 2,523
1 vote
0 answers
173 views

GraphQL Magento 2.4.4 How to add "Additional Options" add to cart

We need to add additional data in cart items like code, label, value, etc. from graphql add to cart. We have reviewed the Magento docs block "CustomizableFieldOption" but not work with my ...
Prince Kumar's user avatar
4 votes
0 answers
429 views

How to add "Additional Options" to product while add to cart using GraphQL

I am using magento's default add to cart graphql to add product in cart. mutation { addSimpleProductsToCart(input: {cart_id: "aIvRj9FfJvQr3qcAECmFfZlVbxcwQ1G6", cart_items: ...
Juber Sherasiya's user avatar
1 vote
1 answer
178 views

Magento 2 graphql authentication

I have created a custom graphql APIs , I want to restrict these APIS for unwanted use , How can I restrict access to API'S Any help is appreciated Thank you.
Smita Kagwade's user avatar
0 votes
1 answer
213 views

Missing field 'uid' while computing key fields when used react mutation graphq

Help me! Not add product with mitation, always show this error. thank you
Yelmy pech's user avatar
3 votes
3 answers
782 views

Magento 2 : What is typeResolver in GraphQL?

I am working on a custom module in which I've implemented graphql. One of the key in response contains different fields. For example, in the below json response the dynamic_fields content will depend ...
Rahul Barot's user avatar
  • 1,062
0 votes
1 answer
145 views

Share wishlist using Graphql mutation

I need to share wishlist using Graphql in Magento2.4. Anyone could assist me in this?
Nivetha's user avatar
0 votes
1 answer
228 views

Magento 2 GraphQL - How to build a Tree structure in response

I have created a custom module for megamenu. I have created the graphQL query for that also. The query returns the correct result for level 0. How can I get the tree structure? Here is my graphql ...
Jancy Abraham's user avatar
0 votes
1 answer
330 views

Custom GraphQl $args is empty on Interface custom attribute resolver

Here is my schema.graphqls type Query { products ( special_code: String @doc(description: "special code") ): Products } interface ProductInterface { addl_data: String @...
rainebow's user avatar
0 votes
0 answers
89 views

Magento 2 how can I retrive order_uid?

I am using Magento 2.4.2 version. for order return I found graphql here https://devdocs.magento.com/guides/v2.4/graphql/mutations/request-return.html I got 'order_item_uid' by using Customer Order ...
Rohit Kaushik's user avatar
2 votes
1 answer
1k views

Magento 2 GraphQl get store wise product collection

I want to get the product collection store-wise via graphQl. I have set in header parameter "Store": "ar", I want to get the product name in the Arabic store, but it's not working. ...
Priya's user avatar
  • 123
0 votes
1 answer
856 views

Magento2 How to get list of products that has special price in graphql

Magento2 How can I set filter for products in order to return products that has special price I am checking this URL but not able to figure out how to achieve this? https://devdocs.magento.com/guides/...
Arjun's user avatar
  • 3,504
1 vote
0 answers
131 views

How to filter product using tier price in Magent 2.4.x

I am using Magento v2.4.3, Elasticsearch 7.13.1 with Graphql. I want to apply a price filter on tier price value. As price coming as per customer group and default filter getting applied on price ...
Vaibhav Mehar's user avatar
1 vote
0 answers
628 views

Magento Graphql Cache issue

I have an issue with Magento graphql cache. Magento PWA setup is on Magento cloud. Default graphql query cache is not working with fastly. Any suggestion?
jayrangnani's user avatar
0 votes
1 answer
312 views

Magento 2 get request parametes in graphql

I want all the applied filters in graphql aggregation Can we use $this-getRequest() in graphql I am getting blank array in $args Any help would be Appreciated!
Charvi Parikh's user avatar
0 votes
2 answers
930 views

Magento graphQL Extending ProductInterface error : Expected a value of type \"Int\" but received

I have created a custom module that will override the ProductInterface class in graphQl as you can se i have mentioned the image_banner as string and i checked the banner.php its also returing string ...
Amiyo Ghosh's user avatar
0 votes
1 answer
827 views

CORS issue fails the communicatin within Magento 2 (Graphql) instance and React app: Response to preflight request doesn't pass access control check:

Getting following error trying to fetch data from react app. Magento 2.4.2 Reac JS v17 Apollo/Client 3 import { ApolloClient, InMemoryCache } from "@apollo/client"; export const client ...
Kapil Dev Singh's user avatar
0 votes
2 answers
298 views

around plugin error | too few to function ::resolve()

This function runs around the resolve function for coupon api on Graphql, once the core function throws exception this function will catch and update the error message. core file [module-quote-graph-...
Kbee's user avatar
  • 31
0 votes
1 answer
236 views

Magento2 using graphql filter products that have special price in it

Magento2 How to filter products that have special price using GraphQL? I want to get the collection of products in Response of product query in GraphQL that have special price. How can I achieve this?
Arjun's user avatar
  • 3,504
0 votes
3 answers
979 views

Magento 2 : Image upload using Graphql mutation

I want to upload images using graphql, can anyone tell me how can I implement this? Let me know if anyone has any idea.
Mohit Rane's user avatar
  • 1,925
0 votes
1 answer
2k views

Magento 2: Graphql how to pass productids as parameter (array) in query

I'm trying to pass productids in the query but I'm not sure how to define it and also need to loop through it, I'm using for each it's showing SyntaxError. I have tried using the productids as ["...
Mohit Rane's user avatar
  • 1,925
1 vote
2 answers
3k views

Magento 2 How to add custom product attribute into existing product graphql query

How to add custom product attribute into existing product graphql query in the custom module in Magento 2. THANKS.
Mohit Patel's user avatar
  • 3,568
1 vote
1 answer
4k views

Magento 2 How to create graphql mutation

How to create custom graphql mutation in custom module in magento 2. And how to save custom form data in custom table using mutation. THANKS.
Mohit Patel's user avatar
  • 3,568
2 votes
2 answers
4k views

Magento 2 How to create graphql query

How to create custom graphql query in custom module in magento 2. THANKS.
Mohit Patel's user avatar
  • 3,568
0 votes
1 answer
307 views

Magento2 Not able to update Address via GraphQl

I have try to update the address via GraphQl but somehow not working Please guide me how can I solve this error
Arjun's user avatar
  • 3,504
0 votes
1 answer
182 views

B2B graphql - company query displays null for company user id

I am working on Graphql API (Magento - 2.4/ enterprise edition) for B2B, the default company query which lists the company users does not give the id since it is deprecated. But I want to update a ...
MagentoUser's user avatar
1 vote
1 answer
1k views

Magento 2: Graphql Custom collection data returns null

I'm creating Graphql for my custom module, but after setting an endpoint and writing a query for it, does not return any data. Below are the files I have created for Graphql, MyVendor/RMAModule/etc/...
Mohit Rane's user avatar
  • 1,925
0 votes
0 answers
408 views

Magento 2 GraphQL How to update custom row

Using Magento 2.4.3 Graphql Able to get, insert and delete a row from the custom table but unable to update(edit) custom row... custom endpoints - mutation { updateCustomMedia(id:7, input: { ...
sumeet bajaj's user avatar
  • 1,195
1 vote
1 answer
2k views

Magento 2.4.3: graphQL ResolveURL response error "Internal server error"

I am working on Magento 2.4.3 setup graphQL with Ubuntu 20.04.3 LTS machine. I setup a pwa-studio with venia-concept theme on the same machine and connected it with the Magento setup. All is running ...
Amit Dwivedi's user avatar
  • 1,508
1 vote
1 answer
298 views

call more than one graphql query in one schema.graphqls file

type Query { productReview: ProductReviewRatingsMetadata! @doc(description: "Retrieves metadata required by clients to render the Reviews section.") @resolver(class: "E50\\Graphql\\...
aich.khalid's user avatar
1 vote
1 answer
357 views

Magento 2 graphQL Get Select attribute option labels in Products Query

I want to get the attribute label value along with the id in the Products graphQL query. like color { id: 12, label: black }, size{ id: 15, label: xl } Currently, it returns the id only. How can I ...
Jancy Abraham's user avatar
1 vote
0 answers
83 views

AddProductsToCart Mutation Custom Option Upload File Magento 2.4

I am struggling to understand the correct way to get a custom option that is an uploaded file to attach correctly when adding a product to cart via graphql. I have tried using entered_options: [ {uid: ...
lilbumblebear's user avatar
1 vote
1 answer
1k views

How to override Magento 2 graphql resolver with custom plugin

Im trying to override the resolver by using a plugin in Magento 2 to change text. vendor/magento/module-quote/Model/CouponManagement.php - I need to change this class ApplyCouponToCart implements ...
Kbee's user avatar
  • 31
0 votes
1 answer
1k views

Magento 2 Graphql Exception handling

I would like to customise the error messages displayed in my GraphQL queries for a coupon code in m2. You should implement the \GraphQL\Error\ClientAware interface to handle errors in your module ...
Kbee's user avatar
  • 31
1 vote
0 answers
30 views

Magento 2 GraphQL on family tree

I have a tree that includes the following information: tree { id: Int parent: tree children: [tree] } How to write graphQL module that can handle the following query: { tree ( id: 4 ) { ...
Truong Nguyen's user avatar
0 votes
0 answers
178 views

Payment method not showing

I have integrated "klarna payments" in magento 2.4.3 EE When i use graphQL mutation on cart id, i can see klarna payment method in available_payment_methods but when i call the endpoint for ...
devhs's user avatar
  • 230
0 votes
0 answers
52 views

How to change the filters position from Venia Storefront like the filters from the Magento front view?

Good afternoon everybody, I am kind of a rookie using magento and I need help with this: This are the filters from Magento front View, this filters can change position changing the position attribute ...
Jesus Iasenzaniro's user avatar
0 votes
1 answer
872 views

How to add Customer Authentication in Custom GraphQl API. Magento 2

I've created a custom GraphQl API app\code\Vendor\Extension\etc\schema.graphqls #Custom Module type Query { CustomGraphql ( username: String @doc(description: "Email Address/Mobile ...
Asad Khan's user avatar
  • 1,466
0 votes
2 answers
688 views

Getting Incorrect Image URL in Custom GraphQL Query

in my Custom Graphql Query, I am trying to get product image Url using Magento\Catalog\Helper\Image in this way $this->imageHelper->init($product, 'product_thumbnail_image')->getUrl(); I am ...
Waqar Ali's user avatar
  • 2,189
1 vote
0 answers
324 views

Magento 2 Customer API Token refresh

I am developing an APP based on magento 2 ecommerce. As any APP, the user should never logged out. I can get with magento 2 a token for any customer by that token have an expery time. I know that I ...
martin's user avatar
  • 39
3 votes
1 answer
729 views

How to enable GraphQL schema intelligence?

Magento has numerous schema. graphics files spread across its modules. It also has custom directives such as @docand@resolver`. When I'm using PhpStorm with the JS GraphQL plugin, what is the best way ...
Adarsh M's user avatar
  • 562
1 vote
1 answer
497 views

Magento 2 : URGENT - Getting same product in resolver

I am using graphql mutation mutation { addProductsToCart( cartId: "KlV2AfyAkbn19yuXE8EaBmabYqh4DMiX" cartItems: [{ quantity: 1, sku: "S359120" }] ) { cart { ...
devhs's user avatar
  • 467
2 votes
0 answers
656 views

Magento 2 add request header to Graphql programmatically

I'm trying to run this Graphql url https://****.***.com/in/graphql by Postman I saw in Magento document that the URL above can contain Store header https://devdocs.magento.com/guides/v2.4/graphql/send-...
Tùng Nguyễn's user avatar
0 votes
1 answer
369 views

graphql product query huge perfomance hit when filtering with multiple attributes

I have used the below GRAPHQL query to get the product list. { products(filter: {category_id: {eq: "77"},color:{in:["5437","5438","5449"]}, price:{from:"...
Devidas's user avatar
  • 3,253