Skip to content

Commit 22d2295

Browse files
BassTfreiksenet
authored andcommitted
Also recreate astNode for fields (#580)
* Also recreate astNode for fields In a [previous commit](fd9f626) we added the `astNode` property in the `reacreateCompositeType` function. That resulted in cache control working with schema stitching but only for GraphQL Types. By recreating the `astNode` prop also in `fieldToFieldConfig` cache control also works for fields. This is required for caching fields and hence queries. * Add ast to input field node too
1 parent 03ad432 commit 22d2295

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
### vNEXT
44

5+
* Also recreate `astNode` property for fields, not only types, when recreating schemas. [PR #580](https://github.com/apollographql/graphql-tools/pull/580)
56
* Fix `delegateToSchema.js` to accept and move forward args with zero or false values [PR #586](https://github.com/apollographql/graphql-tools/pull/586)
67

78
### v2.18.0

src/stitching/schemaRecreation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ function fieldToFieldConfig(
9292
resolve: defaultMergedResolver,
9393
description: field.description,
9494
deprecationReason: field.deprecationReason,
95+
astNode: field.astNode,
9596
};
9697
}
9798

@@ -140,5 +141,6 @@ function inputFieldToFieldConfig(
140141
type: registry.resolveType(field.type),
141142
defaultValue: field.defaultValue,
142143
description: field.description,
144+
astNode: field.astNode,
143145
};
144146
}

0 commit comments

Comments
 (0)