Skip to content

Add an option to fallback to comments if a description is not provided #564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 13, 2021

Conversation

oryan-block
Copy link
Collaborator

Checklist

  • Pull requests follows the contribution guide
  • New or modified functionality is covered by tests

Description

The existing behavior is to always fallback to comments from the schema. This change would add a configuration option to SchemaParserOptions that would make it possible to ignore comments and exclusively use descriptions from the schema.

For example:

# Copyright 2020
# Authors: ...

type Query {
    hello: String!
}

This schema with the current behavior would result in the description being Copyright 2020\nAuthors: ....
With the commentsAsFallbackDescription option set as false, the description will be null.

The default behavior, to match existing behavior, is to fallback to
comments. Setting `commentsAsFallbackDescription` to false in the
`SchemaParserOptions` will result in comments not being used when a
description is not provided.
@oryan-block oryan-block requested a review from vojtapol August 13, 2021 19:36
@oryan-block oryan-block merged commit 1b1803e into master Aug 13, 2021
@oryan-block oryan-block deleted the feature/comment-documentation-2 branch August 13, 2021 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants