Giter VIP home page Giter VIP logo

store-graphql's Introduction

VTEX Store GraphQL

All Contributors

Description

This project is a GraphQL API build in our VTEX IO Platform as an abstraction of all VTEX public REST API that our commerce stores needed.

📢 Disclaimer: Don't fork this project; use, contribute, or open issue with your feature request.

Release schedule

Release Status Initial Release Maintenance LTS Start End-of-life
[2.x] Current Release 2018-03-05
[3.x] Unscheduled ----------

Table of Content

Depreaction Notices

The queries facets, product, products, productSearch, autocomplete, searchMetadata and productsByIdentifier were deprecated. They were moved to a new app vtex.search-graphql, use the queries from that app from now on.

Usage

TODO

Queries

Catalog

  • product - Returns a specified product - DEPRECATED
  • products - Returns products list filtered and ordered - DEPRECATED
  • facets - Returns facets category - DEPRECATED
  • category - Returns a specified category
  • categories - Returns categories tree
  • brand - Returns a specified brand
  • brands - Returns brands list
  • pagetype - Returns the page type based on path and query

Logistics

  • shipping - Returns orderForm shipping simulation

Checkout

  • orderForm - Returns checkout cart details
  • searchOrderForm - Returns a specified checkout cart details

OMS

  • orders - Returns user orders details
  • order - Returns a specified user order
  • userLastOrder - Returns the last order made by a logged in customer

Profile System

  • profile - Returns user profile details

VTEXID

  • loginSessionsInfo - Returns an object with currently active user login sessions and the ID of the current session

Mutations

Checkout

  • addItem
  • updateItems
  • updateOrderFormProfile
  • updateOrderFormShipping
  • updateOrderFormPayment
  • updateOrderFormIgnoreProfile
  • addOrderFormPaymentToken
  • setOrderFormCustomData
  • createPaymentSession
  • createPaymentTokens
  • cancelOrder

Profile System

  • createAddress
  • updateProfile
  • updateAddress
  • deleteAddress

VTEXID

  • logOutFromSession - Logs out from a specific login session (this can't be the current one - it doesn't delete the cookie)

Contributing

TODO

Troubleshooting

You can check if others are passing through similar issues here. Also feel free to open issues.

Contributors

Thanks goes to these wonderful people (emoji key):


Reginaldo


Julio Moreira


gustavopvasconcellos


Lucas Yamamoto


Lucas Pacheco


Beatriz Miranda


Gabriel Carafizi


Marcos André Suarez Ewbank


leoWorkingGood

This project follows the all-contributors specification. Contributions of any kind welcome!

Upcoming documentation:

store-graphql's People

Contributors

allcontributors[bot] avatar amoreira avatar andreaugusto avatar andreldsa avatar brunoabreu avatar dependabot[bot] avatar guifromrio avatar hapoza avatar hiagolcm avatar iago1501 avatar igorbrasileiro avatar jgfidelis avatar klzns avatar lariciamota avatar lbebber avatar leticiawanderley avatar lucasecdb avatar mairatma avatar rafarubim avatar regis-samurai avatar rogerlucena avatar salesfelipe avatar thalytafabrine avatar tlgimenes avatar vcalasans avatar victorhmp avatar vitoria avatar vtex-io-ci-cd[bot] avatar vwraposo avatar wender avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

store-graphql's Issues

Search Queries with specificationFilter returns a empty products object

Expected Behavior

The search query should be able to search any specifications values even if it contains a special character.

Current Behavior

The following variable object with the search query should return all filtered products, but returns an empty array. I suspect it's because of a / in the value of the rest parameter, which is the value of specificationFilter_216.

{
    "query": "Ambientes/Quarto",
    "map": "c,c,specificationFilter_216",
    "rest": "C/Cabideiro",
    "orderBy": "OrderByPriceDESC",
    "from": 0,
    "to": 23
}

Possible Solution

Maybe if change the search path and refactor the logic use the Search API path with fq=specificationFilter_{id}:{value}

Steps to Reproduce (for bugs)

  1. Create a sku field if a value that contains at least a /
  2. Use the store-theme app and go to the category page
  3. Filter the page

Context

I'm using the query with a custom application and filters have this value.

Your Environment

manifest.json:

"builders": {
    "styles": "1.x",
    "store": "0.x"
  },
  "dependencies": {
    "vtex.store": "2.x",
    "vtex.store-header": "2.x",
    "vtex.store-footer": "2.x",
    "vtex.carousel": "2.x",
    "vtex.shelf": "1.x",
    "vtex.product-details": "1.x",
    "vtex.product-kit": "1.x",
    "vtex.search-result": "3.x",
    "vtex.store-components": "3.x",
    "vtex.login": "2.x",
    "vtex.menu": "2.x",
    "vtex.minicart": "2.x",
    "vtex.my-account": "1.x"
  }

Improvement - Add LogisticsInfo and PaymentData

This issue is related with the issue #176 the main objective is to have a complete orderForm features.

Expected Behavior

I would like to change the logisticsInfo and paymentData of the current orderForm using store-graphql mutations.

Current Behavior

Today these mutations do not exist

Your Environment

  • Version used: 2.41.0

There is no way of filtering the products by its availability in stock

There is no way of filtering the products by its availability in stock

Expected Behavior

I should be able to list only the products that are available. As required on this PR

Current Behavior

There is no way of doing that.

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 39, node.js 5.4):
  • Operating System and version (desktop or mobile):
  • Link to your project:

GraphQL product query with specificationFilters that contains special characters.

GraphQL product query with specificationFilters that contains special characters returns default response.

Expected Behavior

It should return the filters values independent of the way you write it.

Current Behavior

When we execute the query it returns a error with a default response.

Steps to Reproduce (for bugs)

  1. Visit www.feed.com.br
  2. Enter in "Carnes" department on navbar.
  3. Select "bovinos" option.
  4. On sidebar filters select a filter that contains special characters like "Carne Moída".
  5. Notice it will return the default results.

Context

Your Environment

  • Version used: "vtex.store-graphql": "2.x"
  • Operating System and version (desktop or mobile): all
  • Link to your project: https://www.feed.com.br/

Thanks!

Implementation of Searchable Products for collections on facets query.

We have a problem with the facets query. It don't return the "Searchable" products that we selected for collections in the dashboard.

Expected Behavior

We need to make a custom Filter Menu and, for that, we need it to return this in the facets query.

Current Behavior

Nowadays it don't returns this.

Your Environment

  • Version used: @2.23.2

Can't logout when the login is made by the default vtexid modal

I'm trying to logout a user that logged in using the old Vtexid modal (the default modal in
the path /login of all VTEX stores). I am using the logout mutation from vtex.store-graphql, the mutation returns true, but the user keep logged in.

Steps to Reproduce

I made a video showing the problem: https://monosnap.com/file/wLQ4P6V07Kxl0iTQYPSXXHeX7yVVma

Your Environment

Missing openTextField from OrderForm

When trying to make an app for a customer, I tried getting the openTextField field, but it does not exist on both query and type. I would open a pull-request, but I don't know if this field really exists on IO graphql. Can someone help me with this?

Expected Behavior

Should return the openTextField as well.

Current Behavior

Does not return openTextField and it's not on the type definition.

Possible Solution

Add the field to the type definition.

Steps to Reproduce (for bugs)

Context

When trying to make an app for a customer, I tried getting the openTextField field, but it does not exist on both query and type. I would open a pull-request, but I don't know if this field really exists on IO graphql. Can someone help me with this?

Your Environment

Error TS2698 Spread types may only be created from object types.

Error while trying to link store-graphql app.

The error is presented in the following route:

../../../cache/link/link_tiendasel_tiendasel/[email protected]/src/node/resolvers/document/index.ts:47:13

The solution was simple, it consists in adding to the constant data of line 45 the type of data any. The result is as follows:

const data: any = await masterdata.getSchema (dataEntity, schema);

When trying to link again the error disappears

Error "updateDocument" graphql mutation

Documentation error "updateDocument" graphql mutation

Expected Behavior

Be able to update fields of a document of the masterdata given the id of the document

Current Behavior

At this time it is not possible to indicate which document I want to edit, however if the code is analyzed, it is ready to receive the document id

Possible Solution

I think the documentation is out of date or has an error, and that the validator graphql must be updated

Context

It is not possible to edit the fields of a document

Images:

  1. Request according to documentation:
    image

  2. Code in this repository (/vtex-apps/store-graphql/blob/master/node/clients/masterdata.ts):
    image

  3. Request according to code:
    image

Can't use private APIs on dataSources

I tried adding /pvt/sku/stockkeepingunitbyid/${id} to catalog dataSource, but the API returns a 401 Not Authorized error.
It's probably missing a header for that, I thought it was Proxy-Authorization with the authToken, tried adding that but didn't resolve the authorization issue.

Expected Behavior

Should be able to use private /pvt/ APIs on dataSources

Current Behavior

Private APIs return a 401 error

Steps to Reproduce (for bugs)

Add this method to dataSources/catalog.ts

public skuById = (id: string) => this.get(
  `/pvt/sku/stockkeepingunitbyid/${id}`
)

Execute ctx.dataSources.catalog.skuById("{{id}}") on a query

Context

Remove the need to implement httpResolver.ts

Your Environment

N/A

options.headers.set is not a function

Expected Behavior

We had some apps using the createDocument mutation previosly, but that stopped working.

Current Behavior

Here's the stacktrace of when we try to send variables to createDocument:

{
  "data": { "createDocument": null },
  "errors": [
    {
      "message": "options.headers.set is not a function",
      "locations": [{ "line": 2, "column": 3 }],
      "path": ["vtex_storegraphql_2_45_0_createDocument"],
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "exception": {
          "stacktrace": [
            "TypeError: options.headers.set is not a function",
            "    at document_DocumentDataSource.<anonymous> (/usr/local/data/service/node_modules/apollo-datasource-rest/src/RESTDataSource.ts:226:23)",
            "    at Generator.next (<anonymous>)",
            "    at fulfilled (/usr/local/data/service/node_modules/apollo-datasource-rest/dist/RESTDataSource.js:4:58)",
            "    at tryCatcher (/usr/local/data/service/node_modules/bluebird/js/release/util.js:16:23)",
            "    at Promise._settlePromiseFromHandler (/usr/local/data/service/node_modules/bluebird/js/release/promise.js:512:31)",
            "    at Promise._settlePromise (/usr/local/data/service/node_modules/bluebird/js/release/promise.js:569:18)",
            "    at Promise._settlePromiseCtx (/usr/local/data/service/node_modules/bluebird/js/release/promise.js:606:10)",
            "    at _drainQueueStep (/usr/local/data/service/node_modules/bluebird/js/release/async.js:142:12)",
            "    at _drainQueue (/usr/local/data/service/node_modules/bluebird/js/release/async.js:131:9)",
            "    at Async._drainQueues (/usr/local/data/service/node_modules/bluebird/js/release/async.js:147:5)",
            "    at Immediate.Async.drainQueues (/usr/local/data/service/node_modules/bluebird/js/release/async.js:17:14)",
            "    at runCallback (timers.js:810:20)",
            "    at tryOnImmediate (timers.js:768:5)",
            "    at processImmediate [as _immediateCallback] (timers.js:745:5)"
          ]
        }
      },
      "positions": [81],
      "name": "GraphQLError",
      "source": {
        "body": "mutation createDocument($_v0_acronym: String!, $_v1_document: DocumentInput) {\n  vtex_storegraphql_2_45_0_createDocument: createDocument(acronym: $_v0_acronym, document: $_v1_document) {\n    id: id\n    __typename\n  }\n}\n",
        "name": "GraphQL request",
        "locationOffset": { "line": 1, "column": 1 }
      }
    }
  ]
}

Here's the mutation that was previously working:

mutation createDocument($acronym: String!, $name: String, $email: String!) {
  createDocument(
    acronym: $acronym
    document: {
      fields: [{ key: "name", value: $name }, { key: "email", value: $email }]
    }
  ) {
    id
  }
}

Possible Solution

N/A

Steps to Reproduce (for bugs)

  1. Try to use createDocument mutation to send data to some MasterData v1 document,

Context

I'm using MasterData v1 entities to store documents as an optin/newsletter subscription datalayer

Your Environment

  • Version used: 2.45.0
  • Environment name and version (e.g. Chrome 39, node.js 5.4): Chrome 71.0.3578.98
  • Operating System and version (desktop or mobile): all
  • Link to your project:

Improvement - Add all the OrderForm fields to OrderForm query

Expected Behavior

Should be able to get all the orderForm fields that return from orderForm API using the orderForm resolver.

Current Behavior

Today we can not call certain fields like logisticsInfo, paymentData, addressId and geoCoordinate

Possible Solution

Update the GraphQL OrderForm types

Your Environment

  • Version used: 2.41.0

isDisposable for the Address input

Is your feature request related to a problem? Please describe.
Carrefour is complaining that users now have many of the same address on their account page

Describe the solution you'd like
Apps that rely on updateOrderFormShipping can't make use of the isDisposable boolean for the address because it's not available on the OrderFormAddressInput type

input OrderFormAddressInput {

Describe alternatives you've considered
We could migrate our apps to use a tailor-made solution to set the shippingAddress via API, but this is not ideal

Additional context
image

Products Context Response

I've noticed that by context, we do not have the object recomendations of the product.

Expected Behavior

I expect to have the recomendations object within the products object to use its similars.

Current Behavior

We do not have recomendations object retrieved by context

Context

I need to implement a sku selector by product card, however I do not have those informations that are being placed at similars.

The query for some products isn't working

Expected Behavior

The product query should return the Product via Slug of the product "test-acupula-do-not-delete", which is in stock and indexed.

Current Behavior

The product query does not work for the "test-acupula-do-not-delete" slug, returning an error code 400, when I change Slug to another product (slug: curs-photo-accretion-grupa-intensive- radu-grozescu) it works normally and the product registration are similar. It also follows the error message.

graphql-error

Possible Solution

Steps to Reproduce (for bugs)

  1. Using GraphiQL (https://vtexio--fstudio.myvtex.com/_v/[email protected]/graphiql/v1) and placing the query below the error message appears, the errors occurs in product page too
    on the Microdata component.
query Product ($slug: String = "test-acupula-do-not-delete") {
  product(slug: $slug) {
    productId
  }
}

Context

Your Environment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.