Questions tagged [graphql]

Denotes questions about Magento GraphQL.

Filter by
Sorted by
Tagged with
1 vote
1 answer
20 views

How to cache GraphQL requests?

My Magento 2.4 isn't caching requests I use many times, like storeConfig via PWA Studio. My request header: x-cache-hits: 0 How could I cache this kind of request to optimize the speed of my page ...
0 votes
1 answer
19 views

createCustomer mutation with custom attribute in magento2

I Have created a module to add custom attribute to createCustomer mutation. Vendor/Module/etc/extension_attributes.xml <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3....
  • 175
0 votes
1 answer
25 views

How to retrieve characteristics attributes of a product in Magento 2 GraphQL API based on their attribute set?

In Magento 2, each product can be assigned with an attribute set, which varies based on the product category. My attribute set contains specific characteristics such as color and manufacturer, which I ...
1 vote
1 answer
50 views

Returning configurable_options and variants are null for configurable products in custom product collection graphql query

I have sellerProducts Query and SellerProducts type has product interface. When i call SellerProducts query it returns configurable_options and variants are null for configurable products in custom ...
0 votes
2 answers
41 views

Magento 2.4.5 Graphql get product by category_id or uid

I'm confused. I'm querying categories and tried to add id field but it says it's deprecated and suggested to use uid instead. But to get products we need category id, when I tried to use uid it doesn'...
0 votes
0 answers
17 views

Magento2 GraphQL for Newly Added Product

I need to create GraphQL for newly added products. Thanks in advance.
0 votes
1 answer
25 views

Magento 2 custom graphql response structure

How can we generate below response structure in graphql ``` { "results": { "itemNames": [ "prod1 - Name", "prod2 - Name", "prod3 - Name&...
0 votes
1 answer
61 views

Magento2 graphql query with access token

How can we add the header parameters in graphql (altair) with authorisation token like postman. In magento2 we have an option in admin system->intergration and we can the add new integration it ...
1 vote
0 answers
34 views

Recently viewed collection is empty magento2

I have created a custom graphQL to get the recently viewed products. I used the following code . <?php class RecentlyViewed implements Magento\Framework\GraphQl\Query\ResolverInterface { protected ...
  • 175
0 votes
0 answers
22 views

Order Not placed in magneto2?

i have created an customer account on magento 2 but when i place a order as guest customer (without logged in) .after completing the order when i login account with same email order not visible in ...
0 votes
0 answers
21 views

Magento 2.4.5-p1: GraphQl unpredictable response

I have a strange issue on Magento 2.4.5-p1 on production (on dev I don't get the issue) When I send a request e.g.: query { storeConfig { store_code code locale secure_base_media_url ...
0 votes
0 answers
42 views

Magento 2 GraphQL categoryList returns limited response

I just started working with Magento2's GraphQL API. Im sending following request: query getCategories { categoryList { uid name children { uid ...
4 votes
1 answer
160 views

How to access the magento 2 graphql api using react js

We are developing a headless eCommerce application for our company, so here is my question how to access the magento2 product collection graphql API which is running on a server using react js which ...
0 votes
1 answer
40 views

Can I Generate Shipment using GraphQL in magento2?

Can i generate Shipment/invoice using GraphQL in magento 2.4.5 ? If yes kindly let me know how to generate, any links with brief details also appreciated.
  • 484
0 votes
0 answers
37 views

Magento2 how to write PHP unit test cases for GraphQl?

Can any one provide me the steps, how to write PHP unit test cases for Magento2 Graphql API with simple example.
0 votes
1 answer
58 views

How to use Grahql API with ACL resouce as Rest API?

We have a issue and want to limit permission each roles. Do we have any way to make Graphql can set permission roles as Rest API? EX: Admin token with roles "sales", they only access Graphql ...
  • 678
0 votes
0 answers
46 views

Get customer token by custom attribute graphQL

I have a headless magento implementation in reactJS. The customer Registration/Login is happening from the third party integration. My question here is Can we generate the customer Bearer token using ...
  • 175
0 votes
0 answers
39 views

Magento2 graphQl special_price filter not working

I am trying to retrieve all products holding a special price value. { products(filter: { special_price: { from: "0.00" ,to:"10.00"} }, sort: { ...
  • 159
0 votes
0 answers
37 views

Remove Category_id attribute from the filterable product attributes GraphQl

Remove the category_id attribute from the filterable product attributes GraphQl Native app development using Apolo APIs and that API adds category_id attribute with null value as a filter and the ...
  • 612
0 votes
0 answers
157 views

Aggregation in custom collection graphql magento2

I am creating a custom graphql query to view list of product. I need to add aggregation to my custom product list. For that I created a schema. type ViewAllProducts { products: [...
0 votes
0 answers
30 views

New product not showing up as cart item in customer's cart

We are using Magento Commerce, on 2.4.3-p2. We recently added a new product to our catalog, with settings that seem to match all of our other products. However, when a customer goes to add the new ...
0 votes
1 answer
34 views

How to prevent cross side scripting in graphql input fields magento2

Here is an example, how to prevent cross side scripting for the firstname & lastname input fields. If any one have the solution please advise. mutation{ createCompanyUser ( ...
0 votes
0 answers
115 views

How to filter products by multiselect attribute in GraphQL request?

So, I have a custom product attribute: $eavSetup->addAttribute('catalog_product', 'visible_in_country', [ 'type' => 'varchar', 'backend_type' => 'text', 'backend_model' => \...
0 votes
1 answer
101 views

Magento 2 create graphql for get homepage content as result

I want to create graphql to get all content in homepage. How to create graphql if anyone has idea please share. Thanks
0 votes
0 answers
29 views

Required parameter "braintree" for "payment_method" is missing in PWA

Good day everyone, Each time a try to do a checkout in magento using credit card it gives this error: Required parameter "braintree" for "payment_method" is missing. The weird ...
2 votes
1 answer
150 views

How to add a Gift Card type product to the cart via graphql

I can't work out the syntax for adding a Gift Card product to the cart using Graphql. What product options need setting? mutation AddProductToCart($cartId: String!, $product: CartItemInput!) { ...
1 vote
1 answer
209 views

how to filter products in GraphQL based on custom type array

I'm trying to add some extra filterable information in the graphql products Query related to the categories. More specifically I want to add the slug and the category id of all associated product ...
  • 581
1 vote
0 answers
68 views

GraphQl Place Order via Stripe

Using Magento 2.4.3 how can i place order via setPaymentMethodOnCart(input: { cart_id: "FnapbGljNrpKfvYzJ4XxUNxzAchDniY3" payment_method: { code: "...
3 votes
1 answer
197 views

Magento2 REST API/GraphQl for Multiple Shipping

I'm Creating PWA Website and I don't find any API for multi-shipping (Ship to Multiple Addresses). I have checked Grapql on Magento's doc https://devdocs.magento.com/guides/v2.4/graphql/mutations/set-...
  • 7,356
1 vote
2 answers
132 views

PWA Cart page graph-ql error

I am using magento 2.4.3-p2. I have installed PWA studio with venia concept theme. I have followed adobe docs to install PWA studio on my local system. I am facing an issue with the cart page. ...
0 votes
1 answer
120 views

Magento2: Country Query is giving the duplicate of regions

I am using the country query to retrieve information about a specific country. When I pass the country code as AU, in the available regions I am getting duplicate values as well as the code and name ...
  • 512
1 vote
1 answer
368 views

Magento 2 GraphQL Error: Undefined property: GraphQL\\Language\\AST\\FragmentSpreadNode::$selectionSet

I am working with magento 2.4.4-p1. I got an error on calling the below graphQL query on the site. query Route($url: String!) { route(url: $url) { redirect_code relative_url ...
0 votes
0 answers
39 views

Magento 2: How to show default shipping address at top of collection?

I am getting all the address collection from Magento\Customer\Model\CustomerFactory. I have also few filters like sorting the address company, etc. Now, I want to display the default shipping address ...
  • 512
0 votes
1 answer
306 views

How to apply coupon code to cart in graphql?

Now i'm trying for apply coupon to cart and i have followed this link: applyCouponToCart mutation https://devdocs.magento.com/guides/v2.4/graphql/mutations/apply-coupon.html But we don't got the mask ...
user avatar
0 votes
1 answer
361 views

Display in GraphQL values from multiple products

I am trying to load in graphql product details. I am only managing to get the details of one product $json['Transaction']['OrderItems'][0] but I would like to get the values for all the products which ...
0 votes
0 answers
241 views

Implement Custom Extension Delete Graphql API with PWA (Magento 2.4)

Please Help me with how I can implement the Delete request with my Custom PWA theme. app/code/Custom/GraphQL/etc/schema.graphqls type Mutation { employeeDelete(input: EmployeeDeleteInput!): ...
  • 2,034
1 vote
0 answers
284 views

How can I improve response query time on Magento PWA with Magento 2.4.3 backend? low response network speed on production with Magento PWA

i'm currently developing a Magento PWA front with a Magento 2.4.3 store on backend. Thing is, when testing on production, and specially Category pages, sometimes the response time of some queries is ...
  • 11
0 votes
2 answers
272 views

Magento 2 graphql image upload using file

I want to upload images using graphql using file not base64, can anyone tell me how can I implement this? Thanks in advance!!
0 votes
1 answer
565 views

Magento2 How to Pass Parameter as Object in GraphQL?

I want to send parameter as object in Graphql but Internal server error occurs. For Reference i have attached graph query and error generated screenshot. I have also attached model and schema.graphql ...
1 vote
3 answers
605 views

Magento 2 How to use header variable in resolver?

I have created one graphql extension for customer OTP send and verify for login with OTP in the project's POS app. There are two requests When POS app request OTP with customer_id and pos session_id, ...
1 vote
1 answer
106 views

Magento 2: Add custom OrderAddress field in GraphQL

I have a requirement where I want to add a custom field in the OrderAddress query of GraphQL. Anyone who have done this can help.
0 votes
0 answers
225 views

Magento 2 Graphql: custom filter products not working

I want to add a custom filter (Stock status filter) to products like this one but it's not working. How to filter product collection with default graphql products query in Magento 2 I used XDebug to ...
0 votes
1 answer
849 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 ...
0 votes
1 answer
140 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.
  • 537
1 vote
1 answer
254 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.
1 vote
1 answer
567 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 ...
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}}&...
  • 2,523
0 votes
0 answers
64 views

Catalog->Product(Admin grid error)--Something went wrong with processing the default view and we have restored the filter to its original state

I'm using magento 2.4.4 added the products programatically using magento graphql.Facing this issue when i open Catalog->products.
0 votes
1 answer
157 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 ...
  • 15
1 vote
0 answers
148 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?
  • 2,523

1
2 3 4 5