fenos / graphql-thinky

GraphQL & Relay powered by thinky / RethinkDB. https://graphql-thinky.readme.io/
MIT License
75 stars 10 forks source link

How do you set a description on a field? #8

Open deep-c opened 8 years ago

deep-c commented 8 years ago

First off, awesome library. I may have missed something in the docs. Im just wondering how we can set a a description for a field and whether this is something we can easily set on the model or whether it will be something that we will need to set when creating the type?

Thanks

fenos commented 8 years ago

Hi @deep-c at the moment is not possible to set a description to an autogenerated GraphQLType of course this is something I want to support. Do you have any idea if will be better to add the description directly into the model(if thinky allows it) or having another field into createModelType function example:

export default GraphQLThinky.createModelType('todo', {
  globalId: true,
  descriptions: {
    fieldName: 'description', 
  },
  fields: () => ({
    fullCount: {
      type: GraphQLInt
    },
    user: {
      type: UserType,
      resolve: resolve('todo','user')
    }
  })
});