Skip to content

Commit ad6e924

Browse files
author
Matthew Rumery
committed
fix: add dataLoaderOptions to gatsby-source-graphql
1 parent 7a410e3 commit ad6e924

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

packages/gatsby-source-graphql/src/gatsby-node.js

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ exports.pluginOptionsSchema = ({ Joi }) =>
2727
createSchema: Joi.function(),
2828
batch: Joi.boolean(),
2929
transformSchema: Joi.function(),
30+
dataLoaderOptions: Joi.object({
31+
batch: Joi.boolean(),
32+
maxBatchSize: Joi.number(),
33+
batchScheduleFn: Joi.function(),
34+
cache: Joi.boolean(),
35+
cacheKeyFn: Joi.function(),
36+
cacheMap: Joi.object({
37+
get: Joi.function(),
38+
set: Joi.function(),
39+
delete: Joi.function(),
40+
clear: Joi.function(),
41+
}),
42+
})
3043
}).or(`url`, `createLink`)
3144

3245
exports.createSchemaCustomization = async (
@@ -101,17 +114,17 @@ exports.createSchemaCustomization = async (
101114

102115
const schema = transformSchema
103116
? transformSchema({
104-
schema: introspectionSchema,
105-
link,
106-
resolver,
107-
defaultTransforms,
108-
options,
109-
})
117+
schema: introspectionSchema,
118+
link,
119+
resolver,
120+
defaultTransforms,
121+
options,
122+
})
110123
: wrapSchema({
111-
schema: introspectionSchema,
112-
executor: linkToExecutor(link),
113-
transforms: defaultTransforms,
114-
})
124+
schema: introspectionSchema,
125+
executor: linkToExecutor(link),
126+
transforms: defaultTransforms,
127+
})
115128

116129
addThirdPartySchema({ schema })
117130
}

0 commit comments

Comments
 (0)