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 ...
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/...
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 ...
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.
...
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 {
...
7
votes
Magento 2 graphql API
Finally found the issue, We need to set customer token to API header.
Authorization Bearer xxxxiuaqxih8va3wbkji691517xxxxxx
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 ...
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 ...
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
...
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 ...
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"),
...
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(
...
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 ...
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 ...
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 ...
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(
...
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
...
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://...
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\...
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 ...
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 ...
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#...
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 ...
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\...
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 ...
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 {
...
3
votes
Magento 2.3.2 Error while Compilation
Backup and delete the file /vendor/magento/module-quote-graph-ql/Model/Cart/SetShippingAddressOnCart.php
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 {
...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
graphql × 234magento2 × 146
magento2.3 × 30
magento2.4 × 17
pwa × 17
api × 16
magento-graphql × 16
pwa-studio × 14
magento2.3.2 × 11
rest-api × 9
customer × 7
query × 7
magento2.4.5 × 7
attributes × 6
magento2.3.3 × 6
product × 5
module × 5
addtocart × 5
venia × 5
php × 4
category × 4
javascript × 4
error × 4
products × 4
magento2.4.4 × 4