Expected DateTime to be a GraphQL nullable type.

default discord avatar
generator101
7 months ago
5

Has anyone faced this issue? I am trying to deploy payload and I get this on the server log



2023-02-24T15:22:23.933722656Z stderr F 
2023-02-24T15:22:23.933610406Z stderr F     at async initHTTP (/home/node/node_modules/payload/dist/initHTTP.js:28:21)
2023-02-24T15:22:23.933607812Z stderr F     at async getPayload (/home/node/node_modules/payload/dist/payload.js:236:26)
2023-02-24T15:22:23.933605289Z stderr F     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-02-24T15:22:23.933602511Z stderr F     at BasePayload.init (/home/node/node_modules/payload/dist/payload.js:209:42)
2023-02-24T15:22:23.933599844Z stderr F     at registerSchema (/home/node/node_modules/payload/dist/graphql/registerSchema.js:58:24)
2023-02-24T15:22:23.9335964Z stderr F     at initCollectionsGraphQL (/home/node/node_modules/payload/dist/collections/graphql/init.js:60:38)
2023-02-24T15:22:23.933593024Z stderr F     at Array.forEach (<anonymous>)
2023-02-24T15:22:23.933589447Z stderr F     at /home/node/node_modules/payload/dist/collections/graphql/init.js:101:23
2023-02-24T15:22:23.933586504Z stderr F     at new GraphQLNonNull (/home/node/node_modules/payload/node_modules/graphql/type/definition.js:395:32)
2023-02-24T15:22:23.933583663Z stderr F     at devAssert (/home/node/node_modules/payload/node_modules/graphql/jsutils/devAssert.js:12:11)
2023-02-24T15:22:23.933578341Z stderr F Error: Expected DateTime to be a GraphQL nullable type.
2023-02-24T15:22:23.933575552Z stderr F 
2023-02-24T15:22:23.933572703Z stderr F           ^
2023-02-24T15:22:23.933567927Z stderr F     throw new Error(message);
2023-02-24T15:22:23.933516156Z stderr F /home/node/node_modules/payload/node_modules/graphql/jsutils/devAssert.js:12
  • discord user avatar
    jesschow
    Payload Team
    6 months ago

    Hi @generator101 - is DateTime a field that you have added?

  • default discord avatar
    generator101
    6 months ago

    no



    I think the issue was related to the npm vs yarn

  • default discord avatar
    sam
    6 months ago

    Similar issue here, but I'm just trying to run a custom docker image.



    Did you end up switching to yarn or were you able to resolve it while continuing to use npm?



    I've just been able to solve it by adding the following to my package.json:



      "overrides": { "graphql@>15.7.0 <16.7.0": "^15.8.0" },
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.