question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feat] strapi v4 with graphql

See original GitHub issue

Describe the bug I suspect there is a bug, but not sure.

strapi v3 graphql query

query {
  users {
    username
    email
  }
}

strapi v4 graphql query, the field nested under attributes

query {
  documents {
    data {
      id
      attributes {
        title
        categories {
          data {
            id
            attributes {
                name
            }
          }
        }
      }
    }
    meta {
      pagination {
        page
        pageSize
        total
        pageCount
      }
    }
  }
}

In refine, it will query like this:

{
  "query": "query ($where: JSON, $sort: String, $start: Int, $limit: Int) { symptomsConnection (where: $where) { aggregate { count } } symptoms (sort: $sort, where: $where, start: $start, limit: $limit) { name } }",
  "variables": {
    "where": {},
    "sort": "id:asc",
    "start": 0,
    "limit": 10
  }
}
  1. Does the symptoms { name } seems use strapi v3 graphql grammer?
  2. There are also error messages on request :
...
"Cannot query field \"symptomsConnection\" on type \"Query\"."
...
"Unknown argument \"where\" on field \"Query.symptoms\"."
...

Do I missing something? Or @pankod/refine-strapi-graphql is used for strapi V3?

deps@pankod/refine-strapi-graphql”: “3.25.6”, “@pankod/refine-strapi-v4”: “3.25.6”,

backend deps@strapi/plugin-graphql”: “4.2.0”, “@strapi/strapi”: “4.2.0”,

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
HaveFcommented, Jun 20, 2022

After some research, except for some technical issues, I find the support to v4 graphql support should be delay.

Lots of complains are found in strapi forum. I guess there would be some changes in the future.

And some technical issues includes:

  • strapi-v4 's normalizeData function could handle response problems
  • but query problems(mess data, attributes) are hard to resolve

@omeraplak close this issue or just leave it to wait?

0reactions
omeraplakcommented, Oct 11, 2022

Spent 2 hours before realizing I needed version 3 of strapi

Sorry to hear that. We should clearly state this in our documents

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get started with GraphQL - Strapi Developer Docs
Use the GraphQL plugin in your Strapi project to fetch and mutate your content.
Read more >
[Feat] strapi v4 with graphql · Issue #1971 · refinedev/refine
Describe the bug I suspect there is a bug, but not sure. strapi v3 graphql query query { users { username email }...
Read more >
How to Build a Product Information Manager Using Strapi
A step-by-step guide to implementing a product information manager with Strapi and creating a storefront with Next.js.
Read more >
Strapi Module - Nuxt
Design APIs fast and manage content easily using REST or GraphQL. ... feat: migrate module to nuxt3 + support strapi v4 by @benjamincanac...
Read more >
Strapi Releases v4 of Headless CMS, Enhances Plugins ...
Strapi, an open source headless CMS, just announced the release of Strapi v4. The platform's latest version offers a reworked core, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found