Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jcm/nexus-plugin-relay-node-interface

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jcm/nexus-plugin-relay-node-interface

Creates the Relay Node interface and add node/nodes fields to the Query type

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@jcm/nexus-plugin-relay-node-interface

Patreon Logo
Discord Logo

This plugin adds the following to the GraphQL schema generated by nexus:

  • Node interface
  • node($id: ID!): Node field on Query
  • nodes($ids: [ID!]!): Node! field on Query

The plugin itself accepts a few configuration options:

idFetcher [required]

A function with signature (idValue, ctx, info) => Object, which should return the node for given idValue

resolveType [required]

A function with signature (object) => string | GraphQLType, which should return the GraphQL type for the given object. This is basically the resolveType of the Node interface created by the plugin.

idParser

A function with signature (id) => any. It will be called with the ID passed to the node / nodes fields, and their result will be used as the first argument passed to idFetcher above. By default this is set to fromGlobalId from graphql-relay.

Keywords

FAQs

Package last updated on 24 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc