Answer the question
In order to leave comments, you need to log in
How to make such queries in GraphQL?
I use vue-apollo for requests, there is a request like this
query {
articles(sort: "created_at:desc", where: { publish = "true"}) {
id
title
image {
url
formats
}
category{
name
url
}
tags {
name
}
created_at
url
}
}
query {
articles(sort: "created_at:desc", where: { category.url = "wow" }) {
id
title
image {
url
formats
}
category{
name
url
}
tags {
name
}
created_at
url
}
}
Answer the question
In order to leave comments, you need to log in
I'm answering my own question.
It is necessary to make a connection, let's say many to many, and choose already 1 category that contains all the articles, for example, I created a schema and make the following request
query categoryByUrl($url: String!) {
categoryByUrl(url: $url) {
name
articles {
id
title
content
image {
url
formats
}
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question