Skip to content

Commit 2206b8b

Browse files
committed
0.8.2 - Allow overriding options for both buildASTSchema and mergeTypeDefs
1 parent e39f3b3 commit 2206b8b

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.8.2
2+
3+
- Allow overriding options for both `buildASTSchema` and `mergeTypeDefs`
4+
15
## 0.8.1
26

37
- Allow overriding options to `mergeTypeDefs` in order to deal with looser validation in extension schemas

lib/index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,21 @@ const { mergeTypeDefs } = require('@graphql-toolkit/schema-merging')
1010

1111
const { schemaModules, bridgingSchemas } = require('./schema-manifest')
1212

13-
function buildSchema(moduleIds, extensionSchemas, options) {
13+
function buildSchema(moduleIds, extensionSchemas, merge_options, build_options) {
1414
// default to all modules
1515
if (!moduleIds || !moduleIds.length) {
1616
moduleIds = Object.keys(schemaModules)
1717
}
1818

19-
if (!options) {
20-
options = { throwOnConflict: true }
19+
if (!merge_options) {
20+
merge_options = { throwOnConflict: true }
2121
}
2222

23+
if (!build_options) {
24+
build_options = { assumeValidSDL: false }
25+
}
26+
27+
2328
// util types are always required
2429
moduleIds.push('util')
2530

@@ -50,7 +55,7 @@ function buildSchema(moduleIds, extensionSchemas, options) {
5055
})
5156

5257
// merge fragments and build GraphQLSchema object
53-
return buildASTSchema(mergeTypeDefs(fragments.concat(extensionSchemas || []), options))
58+
return buildASTSchema(mergeTypeDefs(fragments.concat(extensionSchemas || []), merge_options), build_options)
5459
}
5560

5661
module.exports = {

lib/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@valueflows/vf-graphql",
3-
"version": "0.8.1",
3+
"version": "0.8.2",
44
"description": "Reference GraphQL implementation of the ValueFlows spec",
55
"main": "index.js",
66
"types": "index.d.ts",
@@ -72,4 +72,4 @@
7272
"tape": "^4.10.0",
7373
"tape-catch": "^1.0.6"
7474
}
75-
}
75+
}

0 commit comments

Comments
 (0)