Hi,
Iām currently trying to debug an issue where I can query the graphql preview api with an incorrect slug and receive data.
I have two items of the same type with very similar data but different slugs (and obviously different ids). Iām running a query for them against https://graphql.datocms.com/preview and only seem to get one item in response, regardless of the slug I use.
For example, when I run this query I receive a response with the item with the slug introduction-to-REDACTED-march-24
(which, in the graphql explorer correctly returns null, because this slug doesnāt exist for any item). (The actual slug doesnāt have REDACTED). This is the last updated item, so makes sense that itās on top of the pile.
query: "\n query webinarQuery($slug: SlugFilter) {\n webinar(filter: {slug: $slug}) {\n id\n shortDescription\n description {\n value\n }\n startTime\n endTime\n schedule {\n lengthInMinutes\n scheduleItem\n }\n slug\n title\n partner\n allowRegistration\n hubspotId\n youtubeId\n metadata {\n description\n title\n image {\n url\n alt\n }\n }\n hosts {\n name\n title {\n jobTitle\n company\n }\n photo {\n alt\n url(imgixParams: {w: \"200\", h: \"200\", fit: crop, auto: format})\n }\n }\n featureImage {\n alt\n url\n }\n }\n }\n"
variables: {eq: {slug: "introduction-to-REDACTED-march-10-645"}}
However, when I run the same query for the slug introduction-to-REDACTED-march-10
, I still get the same response, for the item with the slug introduction-to-REDACTED-march-24
Are my slugs too long and itās doing a best guess (because the unique information is at the end rather than the start? I havenāt noticed this issue before with blog slugs, which arguably are āmoreā unique).
EDIT: Actually, Iāve now changed the slugs to be march-10-intro-to-REDACTED and march-24-intro-to-REDACTED and Iām still getting the issue. One of these items was duplicated from the other, but they do have different record ids. Even changing the query itself to break a cache doesnāt seem to be working and Iām still just getting the most recently edited item.