Using Int as name in GraphQL Schema

So, I was creating a graphql schema,

type Details {
1: User!
2: User!
3: User!
id: String!
item: String!
}

What I want is to use the Int (1, 2, 3) in my Schema but not sure how.
Someone must have been in the same situation before, help me figure it out.

>Solution :

Names in GraphQL can include numbers, but they cannot start with a number.

If you need to map over an existing API that returns numbers as fields, you can do a mapping such as this one: Graphql: How to map fields that start with number

Leave a Reply