Hello with our team we've been experiencing some weird issue where the our GraphQL schema differs from development / production environments which leads to failed queries with errors like:
"Field \"in\" is not defined by type \"SkillTree_character_operator\".
With the query in question being:
query {
skillTrees: SkillTrees(where: { character: {in: ["1001"] } } ) {
docs {
id
character {
id
}
}
}
}
Looking at the schemas from playground for both environments gives this:
(Local)
input SkillTree_character_operator {
equals: String
not_equals: String
in: [String]
not_in: [String]
all: [String]
exists: Boolean
}
(Live)
input SkillTree_character_operator {
equals: String
not_equals: String
greater_than_equal: String
greater_than: String
less_than_equal: String
less_than: String
exists: Boolean
}
Our payload schema looks like:
{
name: "character",
type: "relationship",
relationTo: "characters",
hasMany: false,
required: false,
index: true,
},
We're running Payload 1.8.2 and this does seem to happen with any kind of field that's a relationship, but only on production. Updating to 1.8.3 didn't work either
After I updated to 1.8.3 from 1.7.5 I now have this issue. The 'in' operator is no longer present in the schema
Yeah it seems to be an issue with 1.8.3 specifically
Might be caused by this PR:
https://github.com/payloadcms/payload/pull/2693Yeah I can confirm its 1.8.3 issue. When I set my payload version to 1.8.2 in my package.json the issue resolves. Just set payload to be 1.8.2 not ^1.8.2
o interesting
hmmmm. I may have done this, I will repro and correct
yep 100% me, ez fix. Thank you for bringing this to our attention
Fix is here:
https://github.com/payloadcms/payload/pull/2714Oh nice thanks for the quick fix!
Thanks @jarrod69420
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.