graphql 2022-03-23

hello, is there any way to receive a hashmap array as argument of mutation in lacinia?

@fabrao I think you'd have to do it as a string (e.g., JSON). GraphQL spec limitation, not Lacinia.

today I'm using string json to perser in back end, is that correct?

Yes I think that is the only way

Using a JSON scalar type would probably be more neat, but comes with the disadvantages of scalar types. Or have a list with something like key/value elements, preferably better named for the purpose.

❓ 1

You can also model your input, as a plain input type, and require a list of that input as an argument to your mutation. JSON scalars - to me - would be for unstructured data. So it depends on how structured your input actually is ^^

Is that possible to do it in lacinia ?

yes — you can just define :input-objects, for structured data, or a custom scalar for JSON

I think it will solve my problems, thank you