Input Object Type


#1

Hi, I try to save a post to mongo through graphql mutation. The post content is in json format from megadraft component, which built on top of draft.js. Do I have to specify the whole json data structure from megadraft at my graphql schema? Is there any generic input object type that accepts any object as input variable in graphql?

Thanks!


#2

never mind. json is a string, so I can use the String type :slight_smile:


#3

You can use a custom JSON scalar! http://dev.apollodata.com/tools/graphql-tools/scalars.html#JSON-as-a-scalar