1

Is there any way to tell GraphQL that a type is an array filled with Strings OR Integers? Basically this, if it were valid

inputHelper: [[String | Int]]

So in a query I could validly send over

inputHelper: [["foo", 1], ["bar", -1]]

1 Answer 1

1

You could potentially create a custom scalar that could accept either integers or strings.

The easier solution would be to utilize an existing JSON scalar, like the one here. Then you could just do:

inputHelper: [JSON]

or just

inputHelper: JSON
Sign up to request clarification or add additional context in comments.

1 Comment

plus 1 - Thanks a ton - looks incredibly promising. I'll take a closer look tomorrow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.