Skip to content

ID Scalar is incorrectly typed #2588

@n1ru4l

Description

@n1ru4l

Describe the bug

When you return a number as an ID type in a resolver, it causes a typescript error. However, graphql.js does also accept returning numbers which are then automatically cast to strings.

See https://graphql.github.io/graphql-spec/draft/#sec-ID

TL;DR:

ID as operation argument/return type from resolver -> string or number
ID as operation selection set value -> string

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions