GraphQL query syntax in api mode "graphql"

I was trying to use/see the graphQL backend. What I did is change the api mode to “graphql”, is there anything else I need to do here?

The reason I’m asking, when I do this it sends a request like:


to /graphql, instead of

{“query”:"{\n products(filter: {type_id: {eq: “configurable”}})…

The request it sends doesn’t look like a GraphQL request.

If I change searchAdapter.ts to pass:

    const gqlQueryBody = JSON.stringify({
      query: query.loc.source.body,
      variables: gqlQueryVars

It seems to have a valid body; but not sure if I’m meant to do that…

Last but not least, the query looks like:

  customAttributeMetadata()   {     hits   }

But according to the GraphQL spec, all fields for non scalar sub fields have to be explicitly specified (which would make this something like:

query customAttributeMetadata(){
    hits{ hits{_source { attribute_code id default_frontend_label} _index _type _score _id}} }

Hi there! The graphql support in VSF 1.x is far from ideal :frowning:
I tried to fix it to make it work with storefront-api. But it’s really a lot of work to be done so we’re closer to remove the graphql support at all and then to use it only within the Vue Storefront Next Magento2 implementation (we haven’t start this yet). The REST API is more reliable in the VSF1/vue-storefront-api and much more optimized