JSPM

sltx-nexus-plugin-relay-global-id

0.4.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q40129F
  • License MIT

Adds t.relayGlobalId to the schema builder

Package Exports

  • sltx-nexus-plugin-relay-global-id

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sltx-nexus-plugin-relay-global-id) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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!
}
# ...