Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/drop-vscode-from-package.md

This file was deleted.

25 changes: 0 additions & 25 deletions .changeset/merge-overlapping-field-selections.md

This file was deleted.

30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# @khanacademy/graphql-flow

## 5.0.0

### Major Changes

- 61123d4: Merge sub-selections when the same response name is selected through multiple branches (base level + inline fragment, two fragment spreads, etc.) so the generated TypeScript matches what the server actually returns.

**Bug fix.** Previously, a query like

```graphql
hero {
friends { id }
... on Human {
friends { name }
}
}
```

generated a `Human.friends` type containing only `name` — the `id` selection from the base level was silently dropped. graphql-flow now mirrors the GraphQL spec's CollectFields behavior and merges the two `friends` selections, producing `{ id; name }`.

**Behavior change (why this is a major bump):** For queries that mix inline fragments with base-level field selections on an interface, the field-lookup base is now the concrete impl rather than the interface itself. In practice this means:

- JSDoc description comments on fields now come from the concrete impl (e.g. `Human.name`'s description shows up where previously only the bare interface field appeared).
- If any of your interfaces declare covariant field overrides (a concrete impl narrowing the interface's field type), generated types for those fields will now reflect the concrete impl's narrower type when accessed through a fragment refinement on that impl. Runtime data was already this shape; the type is just catching up.

If you depend on the exact previous output (e.g. snapshot tests of generated `.ts` files), expect diffs in interface-with-fragment queries. Regenerate types and review.

### Patch Changes

- 057b2d4: Stop publishing the `.vscode` folder, which the macOS sandbox that coding agents run in can't write into `node_modules`

## 4.0.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@khanacademy/graphql-flow",
"version": "4.0.1",
"version": "5.0.0",
"repository": {
"type": "git",
"url": "https://github.com/Khan/graphql-flow.git"
Expand Down
Loading