Plugin for graphql-compose that wraps GraphQL types with Relay-specific logic, such as the Node interface and global ID handling. Current stable version is 5.0.3, released on 2019-02-14. It provides composeWithRelay() which automatically adds Node interface, globalId field, clientMutationId to mutations, and a node field on the root query for resolving by global ID. Requires graphql-compose ^7.0.4 and graphql. Release cadence is low; last release was in 2019. Compared to manual Relay schema construction, it automatically handles globally unique IDs and Node resolving, reducing boilerplate.
npm install graphql-compose-relayNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to apply composeWithRelay to an ObjectTypeComposer, including required recordIdFn and findById resolver setup, and schema construction.
Ensure UserTC has setRecordIdFn and addResolver for 'findById' before calling composeWithRelay.
Add a resolver named 'findById' to the ObjectTypeComposer before composing.
Use graphql-compose@^7.0.4 as specified in peerDependencies.
Call UserTC.setRecordIdFn(source => source.id) before composeWithRelay.
Add a resolver with name 'findById' to UserTC using addResolver.