I am using GraphQL for Java and need to use Set / HashSet datatype for one of the member of my existing POJO to build by GraphQL schema. Any advice and insight is appreciated.
I am using GraphQL for Java and need to use Set / HashSet datatype for one of the member of my existing POJO to build by GraphQL schema. Any advice and insight is appreciated.
There is no built-in set type in GraphQL , sorry about that.
What you get the closest one is List type which is represented by enclosing any types using [ and ] such as [String] , [Int] , [Bar] etc. It can accept multiple elements but does not guarantee uniqueness between the containing elements.
You may consider to implement a directive for a set behaviour. May be called @set which is placed along with the list data type when defining your GraphQL schema.