Skip to content

Enable GraphQL replay for wildcard and bare leaf field selections#130

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/finish-testing-harness-migration
Draft

Enable GraphQL replay for wildcard and bare leaf field selections#130
Copilot wants to merge 2 commits intomainfrom
copilot/finish-testing-harness-migration

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

Two GraphQL replay scenarios were disabled because the harness couldn't generate valid queries when requestedFields used wildcard patterns (legs.*) or selected object-typed fields as bare leaves (legs).

Changes

  • Wildcard observationmergeObservedSelection now handles *-terminated paths by capturing the parent field's full value, so the schema observer sees the data and infers proper types
  • Selection tree resolution — New resolveSelectionsAgainstSchema expands both wildcards and bare leaf object-typed fields to their schema sub-fields before rendering the GraphQL query:
fields: ["id", "legs.*"]  →  { id legs { duration distance } }
fields: ["id", "legs"]    →  { id legs { name } }
  • Remove disable: ["graphql"] from both sparse fieldset scenarios

Result: 381 pass / 0 skip (was 379 pass / 2 skip).

Original prompt

finish the testing harness Migration in Bridge metapackage.

we have some graphql tests disabled as it's hard the deduct the schema from for partial results

we need to replace the actual return type with JsonObject when user asks for a filed that can have subfields

and we need to generate a correct fields query in case the field is selected as legal.*

so one case needs a custom query generation and one also needs custom schema for the test case

after this is done we can delete the disabled field from the test runner harness.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@changeset-bot
Copy link

changeset-bot bot commented Mar 13, 2026

⚠️ No Changeset found

Latest commit: 4983e70

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

- Handle wildcard paths (e.g. "legs.*") in mergeObservedSelection so the
  schema observer sees the full field data
- Add resolveSelectionsAgainstSchema to expand wildcards and bare leaf
  selections on object-typed fields in the generated GraphQL query
- Remove disable: ["graphql"] from both sparse fieldset test scenarios

Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 13, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bridge 4983e70 Commit Preview URL

Branch Preview URL
Mar 13 2026, 08:06 PM

Copilot AI changed the title [WIP] Finish the testing harness migration in Bridge metapackage Enable GraphQL replay for wildcard and bare leaf field selections Mar 13, 2026
Copilot AI requested a review from aarne March 13, 2026 20:07
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