graphile / graphile-engine

Monorepo home of graphile-build, graphile-build-pg, graphile-utils, postgraphile-core and graphql-parse-resolve-info. Build a high-performance easily-extensible GraphQL schema by combining plugins!
https://www.graphile.org/
762 stars 129 forks source link

Asynchronous builder hooks #771

Closed mgagliardo91 closed 2 years ago

mgagliardo91 commented 2 years ago

I was digging around in the docs and couldn't find anything that stood out: Can builder/plugin hooks support asynchronous execution (returning promises?). The use case involves schema transformation based on external sources which I would like to execute at the time the schema is being rebuilt.

Thanks!

benjie commented 2 years ago

No; schema building is synchronous because it’s an API over GraphQL.js’ API which is also synchronous. Your plugins can do async things but they must complete them before the schema build triggers.