Skip to content

Schema element descriptions can be set through comments #88

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 4 commits into from
Feb 7, 2017

Conversation

ir-regular
Copy link
Contributor

Reason for change:

GraphQL schema shorthand parsing currently doesn't allow for adding descriptions to the type system.

Solution description:

Following the Javascript implementations, comment blocks immediately preceding a definition will be treated as a description.

Some examples:

# This is a description of MyType type
type FriendlyType {
  # This is a field description
  friendlyField: String
}

# This is a floating comment, and is therefore not treated as a description of UnfriendlyType

type UnfriendlyType {
  unfriendlyField: String # not a description, just an aside
}

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 92.988% when pulling 060dc51 on jane-olszewska:schema-description-in-comments into c18cd16 on webonyx:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 93.064% when pulling 008fd20 on jane-olszewska:schema-description-in-comments into c18cd16 on webonyx:master.

@vladar vladar merged commit c2f0749 into webonyx:master Feb 7, 2017
@vladar
Copy link
Member

vladar commented Feb 7, 2017

Awesome! Thanks.

@ir-regular ir-regular deleted the schema-description-in-comments branch February 9, 2017 14:28
@Torsten85
Copy link
Contributor

Am I missing something or do comments disappear when calling AST::fromArray? Calling AST::toArray correctly writes the comments in the returned array.

@vladar
Copy link
Member

vladar commented Jan 17, 2018

Looks like it's the same as #201

@Torsten85
Copy link
Contributor

You are right! I'll keep an eye on that issue. Thank you!

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.

4 participants