@jcm/nexus-plugin-relay-global-id
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

@jcm/nexus-plugin-relay-global-id

Patreon Logo
Discord Logo

This plugin adds the field method relayGlobalId(fieldName, fieldConfig) to the Nexus Schema Builder, which can be used to create Relay-compliant global IDs.

Sample usage:

const User = objectType({
  name: 'User',
  definition(t) {
    // ...
    t.relayGlobalId('id')
    // ...
  },
})

With the above code, the following schema will be generated:

type User {
  id: ID!
  rawId: ID!
}
# ...

Package Sidebar

Install

npm i @jcm/nexus-plugin-relay-global-id

Weekly Downloads

22

Version

0.2.0

License

MIT

Unpacked Size

23.8 kB

Total Files

11

Last publish

Collaborators

  • jonathancardoso