Skip to content

Commit

Permalink
feat(middleware): batched queries support (#749)
Browse files Browse the repository at this point in the history
* feat(plugins): Can add GraphQL validation rules

* Prepare for query batching

* Ability to enable query batching

* Run batched queries in parallel

* Add hook for validating paramsList
  • Loading branch information
benjie committed May 3, 2018
1 parent 7761bb3 commit 5cc82fd
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 121 deletions.
5 changes: 4 additions & 1 deletion src/postgraphile/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ program
.option('-m, --max-pool-size <number>', 'the maximum number of clients to keep in the Postgres pool. defaults to 10', parseFloat)
.option('-r, --default-role <string>', 'the default Postgres role to use when a request is made. supercedes the role used to connect to the database')

pluginHook('cli:flags:standard', addFlag)
pluginHook('cli:flags:add:standard', addFlag)

// Schema configuration
program
Expand Down Expand Up @@ -126,6 +126,7 @@ program
.option('-o, --cors', 'enable generous CORS settings. this is disabled by default, if possible use a proxy instead')
.option('-l, --body-size-limit <string>', 'set the maximum size of JSON bodies that can be parsed (default 100kB) The size can be given as a human-readable string, such as \'200kB\' or \'5MB\' (case insensitive).')
.option('--cluster-workers <count>', '[experimental] spawn <count> workers to increase throughput', parseFloat)
.option('--enable-query-batching', '[experimental] enable the server to process multiple GraphQL queries in one request')

pluginHook('cli:flags:add:webserver', addFlag)

Expand Down Expand Up @@ -228,6 +229,7 @@ const {
legacyRelations: rawLegacyRelations = 'deprecated',
server: yesServer,
clusterWorkers,
enableQueryBatching,
setofFunctionsContainNulls = true,
legacyJsonUuid,
// tslint:disable-next-line no-any
Expand Down Expand Up @@ -350,6 +352,7 @@ const postgraphileOptions = pluginHook('cli:library:options', Object.assign({},
legacyRelations,
setofFunctionsContainNulls,
legacyJsonUuid,
enableQueryBatching,
pluginHook,
}), { config, cliOptions: program })

Expand Down

0 comments on commit 5cc82fd

Please sign in to comment.