Commit 1ebbcfa9 authored by Luke Duncalfe's avatar Luke Duncalfe Committed by Evan Read

Add documentation of GraphQL API copy_field_description helper

parent c3e64742
......@@ -470,6 +470,23 @@ field :confidential, GraphQL::BOOLEAN_TYPE, description: 'Indicates the issue is
field :closed_at, Types::TimeType, description: 'Timestamp of when the issue was closed'
```
### `copy_field_description` helper
Sometimes we want to ensure that two descriptions will always be identical.
For example, to keep a type field description the same as a mutation argument
when they both represent the same property.
Instead of supplying a description, we can use the `copy_field_description` helper,
passing it the type, and field name to copy the description of.
Example:
```ruby
argument :title, GraphQL::STRING_TYPE,
required: false,
description: copy_field_description(Types::MergeRequestType, :title)
```
## Authorization
Authorizations can be applied to both types and fields using the same
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment