Skip to content

Conversation

trevor-scheer
Copy link
Contributor

@trevor-scheer trevor-scheer commented Mar 23, 2022

Description

SchemaExtension nodes are valid graphql but prettier doesn't currently know how to handle them. This adds the ability to print these nodes.

Worth mentioning:

  • SchemaExtension doesn't support description the way SchemaDefinition does
  • node.operationTypes is optional on SchemaExtension whereas it's required on a SchemaDefinition
  • When node.operationTypes is empty, no { } should be printed

Relevant bits in the language spec: https://spec.graphql.org/October2021/#sec-Schema-Extension

Checklist

  • I’ve added tests to confirm my change works.
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

Copy link
Member

@fisker fisker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@fisker fisker mentioned this pull request Mar 25, 2022
4 tasks
@sosukesuzuki sosukesuzuki merged commit 570c318 into prettier:main Mar 26, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants