Questions tagged [graphql]
Denotes questions about Magento GraphQL.
210
questions
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 ...
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.
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.
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 ...
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}}&...
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 ...
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?
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 ...
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:
...
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.
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
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 ...
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?
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 ...
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 @...
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 ...
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.
...
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/...
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 ...
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?
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!
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
...
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 ...
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-...
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?
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.
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 ["...
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.
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.
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.
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
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 ...
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/...
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: {
...
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 ...
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\\...
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 ...
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: ...
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 ...
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 ...
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
) {
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 {
...
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-...
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:"...