0

I have an input type that says:

input testInput {
a: String 
b: String
c: Boolean
}

I have a situation where field c can be either String or Boolean. How can i implement the field c that will accept both String and Boolean ?

1 Answers1

0

Graphql does not support union of scalar types. So you can modify it this way

input testInput { a: String b: String c: hybridType }

type cBoolean { content: Boolean }

type cString { content: String }

union hybridType = cBoolean | cString

rajesh
  • 2,354
  • 1
  • 12
  • 15