Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading