gitlab-org--gitlab-foss/lib/gitlab/graphql
Bob Van Landuyt 406808583c Render GFM html in GraphQL
This adds a `markdown_field` to our types.

Using this helper will render a model's markdown field using the
existing `MarkupHelper` with the context of the GraphQL query
available to the helper.

Having the context available to the helper is needed for redacting
links to resources that the current user is not allowed to see.

Because rendering the HTML can cause queries, the complexity of a
these fields is raised by 5 above the default.

The markdown field helper can be used as follows:

      ```
      markdown_field :note_html, null: false
      ```

This would generate a field that will render the markdown field `note`
of the model. This could be overridden by adding the `method:`
argument. Passing a symbol for the method name:

      ```
      markdown_field :body_html, null: false, method: :note
      ```

It will have this description by default:

> The GitLab Flavored Markdown rendering of `note`

This could be overridden by passing a `description:` argument.

The type of a `markdown_field` is always `GraphQL::STRING_TYPE`.
2019-06-20 08:02:33 +00:00
..
authorize Check for all scalar types 2019-04-22 18:57:45 -05:00
connections Only check abilities on rendered GraphQL nodes 2019-04-18 16:17:29 +02:00
loaders Rename BatchCommitLoader to BatchLfsOidLoader 2019-06-11 16:11:21 +02:00
markdown_field Render GFM html in GraphQL 2019-06-20 08:02:33 +00:00
present Enable even more frozen string in lib/gitlab 2018-11-13 11:42:15 -08:00
query_analyzers Apply reviewer feedback 2019-05-31 19:57:02 +12:00
representation Add web_url to tree entry in GraphQL API 2019-06-05 08:46:32 +01:00
authorize.rb Only check abilities on rendered GraphQL nodes 2019-04-18 16:17:29 +02:00
connections.rb Enable even more frozen string in lib/gitlab 2018-11-13 11:42:15 -08:00
errors.rb Only check abilities on rendered GraphQL nodes 2019-04-18 16:17:29 +02:00
expose_permissions.rb Enable even more frozen string in lib/gitlab 2018-11-13 11:42:15 -08:00
generic_tracing.rb Add opentracing integration for graphql 2019-05-02 07:01:14 +00:00
markdown_field.rb Render GFM html in GraphQL 2019-06-20 08:02:33 +00:00
mount_mutation.rb Updates code using class_methods over module ClassMethods 2018-08-29 16:56:34 +02:00
present.rb Enable even more frozen string in lib/gitlab 2018-11-13 11:42:15 -08:00
variables.rb Enable even more frozen string in lib/gitlab 2018-11-13 11:42:15 -08:00