graphql-thinky icon indicating copy to clipboard operation
graphql-thinky copied to clipboard

How do you set a description on a field?

Open deep-c opened this issue 7 years ago • 1 comments

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

deep-c avatar Nov 02 '16 05:11 deep-c

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')
    }
  })
});

fenos avatar Nov 03 '16 09:11 fenos