Skip to content

GlobalIDs with prismaObject; Using prismaObject and prismaNode in Conjunction #866

Answered by hayes
arimgibson asked this question in Q&A
Discussion options

You must be logged in to vote

You can use t.globalID to add globalID fields: https://pothos-graphql.dev/docs/plugins/relay#global-ids

builder.prismaObject('Tag', {
  fields: t => ({ 
    id: t.globalID(({
      resolve: tag => ({ id: tag.id, type: 'Type' })
    })
  }),
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@arimgibson
Comment options

Answer selected by arimgibson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants