GraphQL schema mismatch between local/live

default discord avatar
dimbreathjr
4 months ago
10

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

  • default discord avatar
    christopher.nowlan
    4 months ago

    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

  • default discord avatar
    dimbreathjr
    4 months ago

    Yeah it seems to be an issue with 1.8.3 specifically



    Might be caused by this PR:

    https://github.com/payloadcms/payload/pull/2693
  • default discord avatar
    christopher.nowlan
    4 months ago

    Yeah 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

  • default discord avatar
    jarrod69420
    4 months ago

    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/2714
  • default discord avatar
    dimbreathjr
    4 months ago

    Oh nice thanks for the quick fix!

  • default discord avatar
    christopher.nowlan
    4 months ago

    Thanks @jarrod69420

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.