gramps-graphql / gramps--legacy

The core data source combination engine of GrAMPS.
https://gramps.js.org
MIT License
197 stars 13 forks source link

gramps returns function #11

Closed ecwyne closed 7 years ago

ecwyne commented 7 years ago

Changes

gramps({dataSources}) => ({schema, context});

Into

gramps({dataSources}) => req => ({schema, context});

This way all of the heavy lifting of combining schemas is done ONCE instead of re-combining on every query. schema is wrapped in a closure and only context is recalculated on every query (as it needs to be)