thunder icon indicating copy to clipboard operation
thunder copied to clipboard

go graphql: add description to fieldfuncs

Open zdylag opened this issue 3 years ago • 0 comments

This fieldfunc option will allow users to set a description value for their field. This will be most useful for people who browse generated docs or Graphiql since they can see an actual message instead of "".


Example code:

object.FieldFunc("echo", func(ctx context.Context, args struct{ Text string }) (string, error) {
		return args.Text, nil
	}, schemabuilder.Description("This mutation lets you echo things! What a cool demo!"))

Example introspection (graphiql doc viewer):

image

zdylag avatar Jul 17 '21 23:07 zdylag