Throwing error when using Map #931
-
Library Version Describe the bug
I debuged this at got totally sure that it happens because of map field. To Reproduce
Expected behavior How to solve In function
I can try to fix it, if you will allow me |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
One of the core principles of GraphQL is the strong type safety. When you use Currently GraphQL spec does not support arbitrary NOTE: You should be able to add support to a generic |
Beta Was this translation helpful? Give feedback.
One of the core principles of GraphQL is the strong type safety. When you use
Map
for storing arbitrary objects it breaks that core assumption - e.g. how will your clients know what are the types stored in the map or in your case how does the client knows what are accepted input parameters? In general, instead of arbitrary map of objects you should be able to model your schema to have more meaningful type.Currently GraphQL spec does not support arbitrary
Map
type (see graphql/graphql-spec#101 for details) so unfortunately we won't be adding support for it to this library.NOTE: You should be able to add support to a generic
Map
type to your schema using schema generator hook.