Skip to content

Commit

Permalink
fix: add dataLoaderOptions to gatsby-source-graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
that1matt committed Jul 12, 2022
1 parent 7a410e3 commit ad6e924
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions packages/gatsby-source-graphql/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ exports.pluginOptionsSchema = ({ Joi }) =>
createSchema: Joi.function(),
batch: Joi.boolean(),
transformSchema: Joi.function(),
dataLoaderOptions: Joi.object({
batch: Joi.boolean(),
maxBatchSize: Joi.number(),
batchScheduleFn: Joi.function(),
cache: Joi.boolean(),
cacheKeyFn: Joi.function(),
cacheMap: Joi.object({
get: Joi.function(),
set: Joi.function(),
delete: Joi.function(),
clear: Joi.function(),
}),
})
}).or(`url`, `createLink`)

exports.createSchemaCustomization = async (
Expand Down Expand Up @@ -101,17 +114,17 @@ exports.createSchemaCustomization = async (

const schema = transformSchema
? transformSchema({
schema: introspectionSchema,
link,
resolver,
defaultTransforms,
options,
})
schema: introspectionSchema,
link,
resolver,
defaultTransforms,
options,
})
: wrapSchema({
schema: introspectionSchema,
executor: linkToExecutor(link),
transforms: defaultTransforms,
})
schema: introspectionSchema,
executor: linkToExecutor(link),
transforms: defaultTransforms,
})

addThirdPartySchema({ schema })
}
Expand Down

0 comments on commit ad6e924

Please sign in to comment.