Description
What happened?
Description
We have a query that fetches entries from section articles
through search functionality. This works as expected however the returned articles are not consistent. A query that should return 1 entry, sometimes returns 0 entries. However this only happens when using a specific schema. If I switch to using the Full schema the problem goes away.
The schema (Nuxt) we're targeting contains everything except for mutations.
This is the query we're using:
query ($site: [String]!, $offset: Int!, $limit: Int!, $searchTerm: String, $category: [String]) {
entryCount(
section: "articles"
site: $site
search: $searchTerm
relatedToCategories: [{slug: $category}]
)
articles: entries(
section: "articles"
site: $site
offset: $offset
limit: $limit
search: $searchTerm
relatedToCategories: [{slug: $category}]
) {
id
searchScore
}
}
Query variables:
{
"site": "swedish",
"offset": 0,
"limit": 10,
"searchTerm": "loppor",
"category": "katt"
}
I made a screen recording to show this behaviour. https://youtu.be/MbqzjB85ymY
Steps to reproduce
- Create a custom schema, include everything except mutations
- Write the above/similar query into GraphiQL and execute it
Expected behavior
The same response each time.
Actual behavior
Different response each time.
Craft CMS version
Craft Pro 4.5.6.1
PHP version
8.2.11
Operating system and version
Linux 5.10.192-183.736.amzn2.x86_64
Database type and version
MySQL 5.7.42
Image driver and version
Imagick 3.7.0 (ImageMagick 7.1.1-13)
Installed plugins and versions
Blitz 4.5.5
Colorit 4.0.0
Cookies 4.0.0
Element API 3.0.1.1
Feed Me 5.2.0
HTTP/2 Server Push Twig 2.0.2
Icon Picker 2.0.14
Image Resizer 3.0.7
Imager X 4.2.3
Mailgun 3.0.0
Minify 4.0.0-beta.2
Navigation 2.0.21
Neo 3.9.4
Preparse Field 2.0.2
Redactor 3.0.4
Retour 4.1.13
Sentry SDK 2.0.1
SEOmatic 4.0.31
Shortcodes 3.0.0
Vite 4.0.6