-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This addresses #158 by using the dataloader pattern to batch and memoize entity calls within the same request. The design followed here introduces the concept of an "execution context" or Executor. An Executor instance is unique to the request, and is to be used as a key to WeakMap caches of entities. Special care must be taken to avoid reusing stale data after a mutation. Accordingly, the Executor instance is replaced in the broader context object by each mutation. Because GraphQL guarantees that mutations are run serially, we don't have to worry about race conditions here.
- Loading branch information
1 parent
9078527
commit f2d5988
Showing
131 changed files
with
5,237 additions
and
4,794 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ | ||
"trailingComma": "none", | ||
"arrowParens": "avoid", | ||
"overrides": [ | ||
{ | ||
"files": ".ts", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,86 @@ | ||
version: "3" | ||
version: "3.7" | ||
|
||
volumes: | ||
postgres: | ||
server_node_modules: | ||
|
||
services: | ||
authx: | ||
build: . | ||
|
||
postgres: | ||
image: postgres:9.6.17 | ||
restart: always | ||
environment: | ||
POSTGRES_PASSWORD: postgres | ||
volumes: | ||
- type: volume | ||
source: postgres | ||
target: /var/lib/postgres | ||
ports: | ||
- "80:80" | ||
- "9229:9229" | ||
- target: 5432 | ||
protocol: tcp | ||
mode: localhost | ||
|
||
# This container doesn't do anything by itself, but can be used to run tests | ||
# or issue one-off commands. | ||
runner: | ||
build: | ||
context: . | ||
target: base | ||
environment: | ||
NODE_ENV: development | ||
PGHOST: postgres | ||
PGUSER: postgres | ||
PGPASSWORD: authx | ||
links: | ||
- postgres | ||
postgres: | ||
image: postgres:11 | ||
PGPASSWORD: postgres | ||
volumes: | ||
- type: bind | ||
source: . | ||
target: /workspace | ||
- type: volume | ||
source: server_node_modules | ||
target: /workspace/node_modules | ||
ports: | ||
- "5432:5432" | ||
- target: 80 | ||
protocol: tcp | ||
mode: localhost | ||
|
||
# This container builds the server. | ||
builder: | ||
build: | ||
context: . | ||
target: base | ||
command: yarn build:development | ||
environment: | ||
POSTGRES_PASSWORD: authx | ||
NODE_ENV: development | ||
volumes: | ||
- type: bind | ||
source: . | ||
target: /workspace | ||
- type: volume | ||
source: server_node_modules | ||
target: /workspace/node_modules | ||
|
||
# This container runs the server. | ||
server: | ||
depends_on: | ||
- builder | ||
- postgres | ||
build: | ||
context: . | ||
target: base | ||
command: yarn start:development | ||
environment: | ||
NODE_ENV: development | ||
PGHOST: postgres | ||
PGUSER: postgres | ||
PGPASSWORD: postgres | ||
volumes: | ||
- type: bind | ||
source: . | ||
target: /workspace | ||
- type: volume | ||
source: server_node_modules | ||
target: /workspace/node_modules | ||
ports: | ||
- target: 80 | ||
protocol: tcp | ||
mode: localhost |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export * from "./dist/util/scopes"; | ||
export * from "./dist/util/createV2AuthorityAdministrationScopes"; | ||
export * from "./dist/util/createV2CredentialAdministrationScopes"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
module.exports = require("./dist/util/scopes"); | ||
module.exports = { | ||
...require("./dist/util/scopes"), | ||
...require("./dist/util/createV2AuthorityAdministrationScopes"), | ||
...require("./dist/util/createV2CredentialAdministrationScopes"), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.