From 4eecf419f21c1908589e7b7f76ea4f63569381ed Mon Sep 17 00:00:00 2001 From: hunterlarco Date: Tue, 6 Oct 2026 13:38:52 -0700 Subject: [PATCH] fix: allow descriptions on executable definitions Bump graphql-buddy to 0.1.7, which parses and validates descriptions on operations, variables, and fragments (GraphQL September 2025). --- e2e/bzlmod/src/documents/BUILD | 8 +++ e2e/bzlmod/src/documents/Described.graphql | 20 ++++++ package.json | 2 +- pnpm-lock.yaml | 76 +++++++++++----------- 4 files changed, 67 insertions(+), 39 deletions(-) create mode 100644 e2e/bzlmod/src/documents/Described.graphql diff --git a/e2e/bzlmod/src/documents/BUILD b/e2e/bzlmod/src/documents/BUILD index 68bc652..66a6f95 100644 --- a/e2e/bzlmod/src/documents/BUILD +++ b/e2e/bzlmod/src/documents/BUILD @@ -40,6 +40,13 @@ graphql_document_library( ], ) +# Descriptions on operations, variables, and fragments (GraphQL September 2025). +graphql_document_library( + name = "Described", + srcs = ["Described.graphql"], + schema = ["//src/schema:Query"], +) + build_test( name = "document_library_test.build", targets = [ @@ -47,6 +54,7 @@ build_test( ":Me.srcsOnly", ":Me.withDeps", ":Composite", + ":Described", ], ) diff --git a/e2e/bzlmod/src/documents/Described.graphql b/e2e/bzlmod/src/documents/Described.graphql new file mode 100644 index 0000000..6227b1b --- /dev/null +++ b/e2e/bzlmod/src/documents/Described.graphql @@ -0,0 +1,20 @@ +""" +Fetches the current user, optionally including their email. +""" +query Described( + "Whether to include the current user's email." + $includeEmail: Boolean! +) { + me { + ...DescribedFields + email @include(if: $includeEmail) + } +} + +""" +The fields always selected on the current user. +""" +fragment DescribedFields on CurrentUser { + id + displayName +} diff --git a/package.json b/package.json index e612124..d631930 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "graphql-buddy": "0.1.4" + "graphql-buddy": "0.1.7" }, "pnpm": { "onlyBuiltDependencies": [] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 245b2b3..62c90bf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: graphql-buddy: - specifier: 0.1.4 - version: 0.1.4 + specifier: 0.1.7 + version: 0.1.7 packages: @@ -211,12 +211,12 @@ packages: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} - graphql-buddy@0.1.4: - resolution: {integrity: sha512-bk2jy+2cx1qrzTn5JafhcLuutqVQojqD6yhLI5zqb2mfdsbOhLlzopRRPe2GrJNKM6X19XgznAJQa3McpODFpQ==} + graphql-buddy@0.1.7: + resolution: {integrity: sha512-2hqsAd1+gV1kEsgSGnUfF4Ov/fiFYfdDGyk17HAg8lX+L4kAUDwf0un5rCTQItWO/Cx0RoDFhiV4lRJK3FKQtw==} hasBin: true - graphql@16.11.0: - resolution: {integrity: sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw==} + graphql@16.14.2: + resolution: {integrity: sha512-Chq1s4CY7jmh8gO2qvLIJyfCDIN+EHLFW/9iShnp1z8FjBQMoodWP1kDC36VAMXXIvAjj4ARa7ntfAV2BrjsbA==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} identifier-regex@1.0.1: @@ -428,60 +428,60 @@ snapshots: dependencies: commander: 14.0.1 - '@graphql-tools/graphql-file-loader@8.1.2(graphql@16.11.0)': + '@graphql-tools/graphql-file-loader@8.1.2(graphql@16.14.2)': dependencies: - '@graphql-tools/import': 7.1.2(graphql@16.11.0) - '@graphql-tools/utils': 10.9.1(graphql@16.11.0) + '@graphql-tools/import': 7.1.2(graphql@16.14.2) + '@graphql-tools/utils': 10.9.1(graphql@16.14.2) globby: 11.1.0 - graphql: 16.11.0 + graphql: 16.14.2 tslib: 2.8.1 unixify: 1.0.0 transitivePeerDependencies: - supports-color - '@graphql-tools/import@7.1.2(graphql@16.11.0)': + '@graphql-tools/import@7.1.2(graphql@16.14.2)': dependencies: - '@graphql-tools/utils': 10.9.1(graphql@16.11.0) - '@theguild/federation-composition': 0.20.1(graphql@16.11.0) - graphql: 16.11.0 + '@graphql-tools/utils': 10.9.1(graphql@16.14.2) + '@theguild/federation-composition': 0.20.1(graphql@16.14.2) + graphql: 16.14.2 resolve-from: 5.0.0 tslib: 2.8.1 transitivePeerDependencies: - supports-color - '@graphql-tools/load@8.1.2(graphql@16.11.0)': + '@graphql-tools/load@8.1.2(graphql@16.14.2)': dependencies: - '@graphql-tools/schema': 10.0.25(graphql@16.11.0) - '@graphql-tools/utils': 10.9.1(graphql@16.11.0) - graphql: 16.11.0 + '@graphql-tools/schema': 10.0.25(graphql@16.14.2) + '@graphql-tools/utils': 10.9.1(graphql@16.14.2) + graphql: 16.14.2 p-limit: 3.1.0 tslib: 2.8.1 - '@graphql-tools/merge@9.1.1(graphql@16.11.0)': + '@graphql-tools/merge@9.1.1(graphql@16.14.2)': dependencies: - '@graphql-tools/utils': 10.9.1(graphql@16.11.0) - graphql: 16.11.0 + '@graphql-tools/utils': 10.9.1(graphql@16.14.2) + graphql: 16.14.2 tslib: 2.8.1 - '@graphql-tools/schema@10.0.25(graphql@16.11.0)': + '@graphql-tools/schema@10.0.25(graphql@16.14.2)': dependencies: - '@graphql-tools/merge': 9.1.1(graphql@16.11.0) - '@graphql-tools/utils': 10.9.1(graphql@16.11.0) - graphql: 16.11.0 + '@graphql-tools/merge': 9.1.1(graphql@16.14.2) + '@graphql-tools/utils': 10.9.1(graphql@16.14.2) + graphql: 16.14.2 tslib: 2.8.1 - '@graphql-tools/utils@10.9.1(graphql@16.11.0)': + '@graphql-tools/utils@10.9.1(graphql@16.14.2)': dependencies: - '@graphql-typed-document-node/core': 3.2.0(graphql@16.11.0) + '@graphql-typed-document-node/core': 3.2.0(graphql@16.14.2) '@whatwg-node/promise-helpers': 1.3.2 cross-inspect: 1.0.1 dset: 3.1.4 - graphql: 16.11.0 + graphql: 16.14.2 tslib: 2.8.1 - '@graphql-typed-document-node/core@3.2.0(graphql@16.11.0)': + '@graphql-typed-document-node/core@3.2.0(graphql@16.14.2)': dependencies: - graphql: 16.11.0 + graphql: 16.14.2 '@isaacs/balanced-match@4.0.1': {} @@ -510,11 +510,11 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.19.1 - '@theguild/federation-composition@0.20.1(graphql@16.11.0)': + '@theguild/federation-composition@0.20.1(graphql@16.14.2)': dependencies: constant-case: 3.0.4 debug: 4.4.1 - graphql: 16.11.0 + graphql: 16.14.2 json5: 2.2.3 lodash.sortby: 4.7.0 transitivePeerDependencies: @@ -629,21 +629,21 @@ snapshots: merge2: 1.4.1 slash: 3.0.0 - graphql-buddy@0.1.4: + graphql-buddy@0.1.7: dependencies: '@commander-js/extra-typings': 14.0.0(commander@14.0.1) - '@graphql-tools/graphql-file-loader': 8.1.2(graphql@16.11.0) - '@graphql-tools/load': 8.1.2(graphql@16.11.0) - '@graphql-tools/utils': 10.9.1(graphql@16.11.0) + '@graphql-tools/graphql-file-loader': 8.1.2(graphql@16.14.2) + '@graphql-tools/load': 8.1.2(graphql@16.14.2) + '@graphql-tools/utils': 10.9.1(graphql@16.14.2) commander: 14.0.1 glob: 11.0.3 - graphql: 16.11.0 + graphql: 16.14.2 stringify-object: 6.0.0 tslib: 2.8.1 transitivePeerDependencies: - supports-color - graphql@16.11.0: {} + graphql@16.14.2: {} identifier-regex@1.0.1: dependencies: