Skip to main content
34 votes

Magento 2.3 use of `db_schema_whitelist.json` file in etc directory of each module

The db_schema_whitelist.json file is a way of telling Magento which tables and columns it can safely alter using the db_schema.xml file. It was added to preserve backward compatibility and will be ...
Daniel Kratohvil's user avatar
33 votes

Magento 2.3 use of `db_schema_whitelist.json` file in etc directory of each module

db_schema_whitelist.json file provides a history of all tables, columns, keys added with declarative schema. It can be generated manually or created automatically with the following command : php bin/...
Rohan Hapani's user avatar
  • 17.5k
10 votes
Accepted

What is GraphQl in Magento2 and Why use?

As magento is using "PWA" it is also adding "GraphQL API" for providing front-end development side api alternative of "REST/SOAP" as "GraphQL" api. GraphQL GraphQL is a query language for using ...
Aditya Shah's user avatar
  • 7,627
10 votes

Magento 2 GraphQL Tutorial Collection

I have written some graphQl related articles.Please have a look and share your thoughts.Hope these articles will help some one. All articles are based on my current project which i found solutions. ...
Mujahidh's user avatar
  • 2,823
9 votes
Accepted

How to use customer token to access my account Query or Mutation in GraphQl

Please try this: Step 1: Get a bearer token: You can get a token by executing the signup mutation in the playground to create a new user. This is the signup mutation I ran: Request: mutation { ...
Narendra Vyas's user avatar
7 votes

Magento 2 graphql API

Finally found the issue, We need to set customer token to API header. Authorization Bearer xxxxiuaqxih8va3wbkji691517xxxxxx
Niranjan Gondaliya's user avatar
7 votes
Accepted

Magento 2 How to create graphql query

I have cerate custom module for get customer details by customer email. Step 1 :- You Create registration.php file <?php /** * @author Mohit Patel * @copyright Copyright (c) 2021 * @package ...
Mohit Patel's user avatar
  • 3,923
6 votes

Magento 2.3 use of `db_schema_whitelist.json` file in etc directory of each module

Magento 2 versions from 2.3 have a replacement for traditional install/upgrade schema which is used to maintain the database structure. From Magento 2 version 2.3, they have introduced the declarative ...
Gohil Rajesh's user avatar
  • 3,000
6 votes

How to get custom product attributes values using graphQl queries in magento 2.3?

For product attributes to be available in GraphQL, is_user_defined has to be true AND at least one of the following: is_comparable is_filterable is_filterable_in_search is_visible_on_front ...
Fabian Schmengler's user avatar
6 votes
Accepted

GraphQL product quantity in stock

It's not possible as of yet and I'm not sure it will be implemented in the future since, usually, on frontend you don't need the exact qty. You can stock_status or only_x_left_in_stock. If you need ...
hestajoe's user avatar
  • 230
6 votes
Accepted

Magento 2.3.3 Getting issue in custom module GraphQL

Try with below code. type StoreHolidayInfo { dates: holidayDates, days: String, details: [holidayDetails] } type holidayDates { repetitive: [String] @doc(description: "holiday id"), ...
Yash Shah's user avatar
  • 2,503
6 votes
Accepted

How to add swatch data in Layered navigation aggregations in graphql?

I have override aggregations GraphQL API. Below code is working for me File:-Custom/Module/registration.php use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register( ...
Devidas's user avatar
  • 3,368
5 votes

Magento 2.3 & pwa studio: How can I access another store to update data or get data other than that of the default store? Is it possible?

GraphQL request accepts the Store into headers. Header Key : Store Header Value : <store_view_code> The store view code on which to perform the request. The value can be default or the code ...
Msquare's user avatar
  • 9,268
5 votes
Accepted

How to access the magento 2 graphql api using react js

We also faced the same issue for my Headless project. Try below two possible solutions. Solution 1 : Add the below line at the top of the index.php file. You can find the index.php file in the root ...
Jitendra Patel's user avatar
4 votes

How to extend or override default graphql query, mutation or schema

Steps to extend the default mutation: Create a schema.graphqls file in you Module->etc->schema.graphqls. Copy the schema from the core module and paste it in your schema.graphql file. Add ...
nihal malik's user avatar
4 votes

Adding extension attribute to customer in GraphQL Magento 2

Magento 2.4 Try This Code app/code/VendoreName/ModuleName/etc schema.graphqls type Customer { sample_attribute: String @doc(description: "Customer Custom Attribute Show") @resolver( ...
Msquare's user avatar
  • 9,268
4 votes

Magento 2 : How to create custom GraphQl to Access Customer Data?

There is already an in-built GraphQl query to retrieve customer data. You can get core Magento customer data via below query. { customer { firstname lastname suffix email id ...
Sukeshini's user avatar
  • 9,975
4 votes

Magento 2.3 & pwa studio: How can I access another store to update data or get data other than that of the default store? Is it possible?

For Storewise Graphql queries you need to add a variable in HEADER just like AUTHORIZATION in Magento 2 . The Header for Store wise data is Store: for more Information you can check https://...
Shikha Mishra's user avatar
4 votes

magento event not fireing with graphql

#1 First Solution Well as I looked it up, the event customer_register_success executes only when the form submits to the url customer/account/createpost here is the controller\Magento\Customer\...
Vyacheslav Shmal's user avatar
4 votes
Accepted

How to enable GraphQL schema intelligence?

I used this following article. There are still some errors, so I think there may be other config settings needed. Select the GraphQL tab in the bottom frame Click + sign, choose a base directory, and ...
ptrollins's user avatar
4 votes
Accepted

Magento 2 How to create graphql mutation

I have create GraphQl mutation for contact us. Please follow below steps. Step 1 :- You Create registration.php file <?php /** * @author Mohit Patel * @copyright Copyright (c) 2021 * @package ...
Mohit Patel's user avatar
  • 3,923
4 votes
Accepted

How to install PWA in Magento 2.4.4 in windows

You cannot (technically you can but shouldn't) since Magento is not supported on Windows. See https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/system-requirements.html#...
Petar Borisovski's user avatar
4 votes

Magento2 REST API/GraphQl for Multiple Shipping

I'm not sure there is a GraphQL endpoint in core Magento that allows you to define multiple shipping addresses on a given cart. The core setShippingAddressesOnCart mutation does NOT allow multiple ...
Liam Toohey's user avatar
3 votes

Magento 2 : How to create custom GraphQl to Access Customer Data?

Step 1: Register new module File path: /app/code/Custom/CustomGraphQl/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\...
Pramod's user avatar
  • 1,464
3 votes
Accepted

Magento2 : What is the use of schema.graphqls file in GraphQL

The schema.graphqls file provides the information about generally two types of queries supported by GraphQL language. They are: 1. type Query to get/read data. 2. type Mutation to perform CRUD ...
Chandan Rai's user avatar
3 votes

Magento 2 GraphQL: Filter Products by custom attribute

Magento 2.4 Filter, sort, and get product custom attribute Create Custom Attribute with below options values. app/code/VendoreName/ModuleName/etc schema.graphqls interface ProductInterface { ...
Msquare's user avatar
  • 9,268
3 votes

Magento 2.3.2 Error while Compilation

Backup and delete the file /vendor/magento/module-quote-graph-ql/Model/Cart/SetShippingAddressOnCart.php
crdt's user avatar
  • 41
3 votes

How to submit contact us data to Magento 2 contact us form action using graphqL?

Since we don't have default contact us mutation in default magento graphql, I did this task with a custom module. For this we want to create the custom contact us Mutation. type Mutation { ...
Mujahidh's user avatar
  • 2,823
3 votes

How to extend or override default graphql query, mutation or schema

If I am not wrong you meant to ask What if we’re adding a custom attribute, e.g., an attribute we’ve added to the database? And how we gonna deal with making that attribute available to GraphQL. So ...
Chandan Rai's user avatar
3 votes

How to remove GraphQL from Magento 2.3?

You might be able to remove it from your Magento 2.3 installing this package below: composer require yireo/magento2-replace-graphql:2.3.1 OR You could specify the packages to be removed in your ...
Rafael Corrêa Gomes's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible