graphql-nexus / nexus

Code-First, Type-Safe, GraphQL Schema Construction
https://nexusjs.org
MIT License
3.4k stars 275 forks source link

Allow connection plugin to accept a non-string cursor type #515

Open jgnieuwhof opened 4 years ago

jgnieuwhof commented 4 years ago

Thanks for the connection plugin! I'm on a team that had made our own, one small change and we'll be able to deprecate ours, and use yours 😅.

The relay connection plugin currently hardcodes the cursor fields to be of the string type:

We'd like to be able to configure the cursor fields to be of a non-string, custom scalar type.

tgriesser commented 3 years ago

Ah interesting - I suppose this is allowed in the spec https://relay.dev/graphql/connections.htm#sec-Cursor

Should be easy to add... cursorType?

jgnieuwhof commented 3 years ago

That works, thank you!