Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

GraphQL schema mismatch between local/live

default discord avatar
dimbreathjr2 years ago
6

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.nowlan2 years 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
    dimbreathjr2 years 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.nowlan2 years 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

  • discord user avatar
    jarrod_not_jared
    2 years 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
    dimbreathjr2 years ago

    Oh nice thanks for the quick fix!

  • default discord avatar
    christopher.nowlan2 years ago

    Thanks

    @281120856527077378
Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.