Skip to content

fix(scalars): add missing @specifiedBy URL to the HSLA scalar#3080

Open
greymoth-jp wants to merge 1 commit into
graphql-hive:masterfrom
greymoth-jp:fix/hsla-specified-by-url
Open

fix(scalars): add missing @specifiedBy URL to the HSLA scalar#3080
greymoth-jp wants to merge 1 commit into
graphql-hive:masterfrom
greymoth-jp:fix/hsla-specified-by-url

Conversation

@greymoth-jp

Copy link
Copy Markdown

The HSL scalar sets specifiedByURL (plus the lowercase specifiedByUrl alias that graphql v15 reads), so its printed type is scalar HSL @specifiedBy(url: "..."). Its sibling HSLA was missing both keys, so it prints a bare scalar HSLA with no @specifiedBy directive, even though the MDN page they share (#hsl()_and_hsla()) covers both functions.

This just copies the same URL onto HSLA so the pair stays in sync. Output with graphql 16:

- scalar HSLA
+ scalar HSLA @specifiedBy(url: "https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#hsl()_and_hsla()")

I added a test asserting GraphQLHSLA.specifiedByURL matches HSL's. On master it fails with Received: undefined; with the change jest tests/HSLA.test.ts tests/HSL.test.ts is green (13 passing) and prettier is clean. Changeset included as a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant