[v4] graphql query v3 convert to v4

System Information

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


As we all know, strapi graphql v4 changed its grammar. Can I have a easier way(not manually) to change my v3 grammar to v4 grammar? And some codes I build query with gql-query-builder, v3 just works fine, can I just a wrapper or converter to make it works on v4 graphql?

Btw, I don’t know why v4 grammar contains a lot of noisy information, like data , attributes things… :joy:

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
      }
    }
  }
}
2 Likes

Ok, it seems I’m not the only one who are troubled…

1 Like

It is a problem for all GraphQL users, it is a big pain, and it seems it won’t be fixed never.

1 Like

It also breaks caching so hold off updating until it’s fixed.