Closed leandrosantoss closed 1 week ago
Hi @leandrosantoss ,
EverShop uses Graphql for query data. So instead of looking for REST API, you can check the Graphql query
Thanks
Yes, I managed it via GraphQL. I'm going to integrate ecommerce with a chatbot and I'm having trouble understanding:
In the chatbot, the customer will list categories, then list products in the category, add to cart, generate order and finalize.
My code is in nodejs and I will need to make calls to Evershop.
Can you help me?
Here, is basic flow
So you are looking for an API which help you create a new shopping cart and return the ID of the cart, from here you can add item and finish the checkout based on the cart ID right?
Yes, perfect!
Do you help me?
Thanks!
There could be a feature that just creates a cart:
POST /carts Request:
{
"full_name": {{customer_name}}
"email": {{customer_email}}
}
Response:
{
"cardId": {{cardId}}
}
If there is an active cart (by email) return the existing one, so you can continue your purchase.
What do you think?
Hi @leandrosantoss ,
Yes it is a good Idea. How about we ask for at lease 1 first item to create a cart?
Something like
POST /carts Request:
{
"full_name": {{customer_name}},
"email": {{customer_email}},
"items": [
{
"sku": "justasku",
"qty": 1
}
]
}
Yes, perfect!
Do you implement? Or do I implement it?
Hi @leandrosantoss ,
I will implement it, it will be included in the next release. I will let you know the timeline soon. Ideally in this month
Thanks
Ok, thanks @treoden !
I await the schedule to continue my development
If you need help I can help you.
Thanks!
Hi, @treoden
Prioritized for this month?
Thanks
Yes I am working on it @leandrosantoss
Thank you very much
Hi @treoden,
PR 512 contains this implementation, correct?
What version of evershop should I put in package.json to pull this FEATURE?
Thanks
Hi @leandrosantoss ,
Yes the PR includes the create cart API. Please wait, I am doing some more test and release a package to the npm. I will keep you posted here. Thanks
Hi @treoden , I installed the new version 1.1.0.
I run the build:
> evershop build ✔ Client ✔ Server Compiled successfully in 1.93m
I run start: `> ecommerce@1.0.0 start
evershop start production`
But no message "Started sucessful in localhost:3000"
If execute https://localhost:3000 in browser, display this error:
In terminal this error:
❌ error: Enum "FilterOperation" cannot represent non-enum value: "=". GraphQLError: Enum "FilterOperation" cannot represent non-enum value: "=". at GraphQLEnumType.parseLiteral (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\type\definition.js:1140:13) at isValidValueNode (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\validation\rules\ValuesOfCorrectTypeRule.js:154:30) at Object.StringValue (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\validation\rules\ValuesOfCorrectTypeRule.js:118:28) at Object.enter (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\language\visitor.js:301:32) at Object.enter (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\utilities\TypeInfo.js:391:27) at visit (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\language\visitor.js:197:21) at validate (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\graphql\validation\validate.js:91:24) at graphql (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\@evershop\evershop\src\modules\graphql\pages\global\[buildQuery]graphql[notification].js:32:34) at asyncMiddlewareWrapper (C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\@evershop\evershop\src\lib\middleware\async.js:24:18) at C:\Users\lpdsa\Documents\Projetos\SquidTech\Git\ecommerce\node_modules\@evershop\evershop\src\lib\middleware\buildMiddlewareFunction.js:56:11
Help me understand if something is wrong?
Hi @leandrosantoss
This new release comes with a changes to the FillterOperation
input GraphQL query.
If you are working on a customization using GraphQL collection filtering, you will have to pass the operation
argument to the query variable.
{key: 'type', value: 'select'}
{ key: 'type', operation: 'eq', value: 'select' }
The operation
value should be one of the following: eq, neq, gt, gteq, lt, lteq, like, nlike, in, nin
Thank you
Hi @leandrosantoss ,
Let me know if you solved the issue. You can refer to my commit here for example: https://github.com/evershopcommerce/evetheme/commit/3de75b1a34aa24ae9b9c4165db7f2977360a5639
Thanks
Resolved! I validated the POST/carts API and it worked perfectly. Thank you for your help.
Hello everyone, I installed evershop, but I didn't understand how to do a GET /products.
I'll need some GET that don't exist in the catalog:
GET /products GET /products/:id GET /categories GET /categories/:id ... etc
Do I need to implement something? Can you help me?
Thanks!