0

I am new to GraphQL and was wondering if one of my model types can have an attribute as a dictionary. Like so ...

type Post @model{
views: [String: Int]
}

Is this the correct syntax? I was unable to find anything related to graphql and dictionaries.

GBMR
  • 594
  • 1
  • 7
  • 16
  • Does this answer your question? [Custom map keys in GraphQL response](https://stackoverflow.com/questions/41557536/custom-map-keys-in-graphql-response) – Herku Mar 10 '21 at 23:45
  • No, I need to declare a dictionary in my schema. @Herku – GBMR Mar 10 '21 at 23:58
  • 1
    Well, the answer is, that is not possible. Instead of dictionary, the word map is often used in this context. You will probably find lots of discussions about this topic on the internet, if you want to know why there are no dictionaries/maps in GraphQL. – Herku Mar 11 '21 at 00:08
  • I see... Can I declare a word map in my schema? @Herku – GBMR Mar 11 '21 at 00:23

0 Answers0