Skip to content

Commit

Permalink
Update .access to be keyed by schemaName (#1604)
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie authored Sep 10, 2019
1 parent 169ab0d commit 89c0d7e
Show file tree
Hide file tree
Showing 30 changed files with 523 additions and 201 deletions.
168 changes: 168 additions & 0 deletions .changeset/smart-avocados-taste/changes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
{
"releases": [
{ "name": "@keystone-alpha/field-content", "type": "major" },
{ "name": "@keystone-alpha/fields-auto-increment", "type": "major" },
{ "name": "@keystone-alpha/fields-datetime-utc", "type": "major" },
{ "name": "@keystone-alpha/fields", "type": "major" }
],
"dependents": [
{
"name": "@keystone-alpha/cypress-project-basic",
"type": "patch",
"dependencies": [
"@keystone-alpha/app-admin-ui",
"@keystone-alpha/fields-markdown",
"@keystone-alpha/keystone",
"@keystone-alpha/field-content",
"@keystone-alpha/fields"
]
},
{
"name": "@keystone-alpha/adapter-knex",
"type": "patch",
"dependencies": ["@keystone-alpha/keystone", "@keystone-alpha/fields-auto-increment"]
},
{
"name": "@keystone-alpha/api-tests",
"type": "patch",
"dependencies": [
"@keystone-alpha/adapter-knex",
"@keystone-alpha/auth-password",
"@keystone-alpha/keystone",
"@keystone-alpha/fields"
]
},
{
"name": "@keystone-alpha/demo-project-blog",
"type": "patch",
"dependencies": [
"@keystone-alpha/app-admin-ui",
"@keystone-alpha/auth-password",
"@keystone-alpha/fields-markdown",
"@keystone-alpha/fields-wysiwyg-tinymce",
"@keystone-alpha/keystone",
"@keystone-alpha/fields"
]
},
{
"name": "@keystone-alpha/demo-project-meetup",
"type": "patch",
"dependencies": [
"@keystone-alpha/app-admin-ui",
"@keystone-alpha/auth-password",
"@keystone-alpha/fields-wysiwyg-tinymce",
"@keystone-alpha/keystone",
"@keystone-alpha/fields"
]
},
{
"name": "@keystone-alpha/demo-project-todo",
"type": "patch",
"dependencies": [
"@keystone-alpha/app-admin-ui",
"@keystone-alpha/keystone",
"@keystone-alpha/fields"
]
},
{
"name": "@keystone-alpha/app-admin-ui",
"type": "patch",
"dependencies": ["@keystone-alpha/fields"]
},
{
"name": "@keystone-alpha/auth-passport",
"type": "patch",
"dependencies": ["@keystone-alpha/fields"]
},
{
"name": "@keystone-alpha/auth-password",
"type": "patch",
"dependencies": ["@keystone-alpha/fields"]
},
{
"name": "@keystone-alpha/example-projects-starter",
"type": "patch",
"dependencies": [
"@keystone-alpha/app-admin-ui",
"@keystone-alpha/auth-password",
"@keystone-alpha/keystone",
"@keystone-alpha/fields"
]
},
{
"name": "@keystone-alpha/example-projects-todo",
"type": "patch",
"dependencies": [
"@keystone-alpha/app-admin-ui",
"@keystone-alpha/keystone",
"@keystone-alpha/fields"
]
},
{
"name": "@keystone-alpha/fields-markdown",
"type": "patch",
"dependencies": ["@keystone-alpha/fields"]
},
{
"name": "@keystone-alpha/fields-mongoid",
"type": "patch",
"dependencies": ["@keystone-alpha/adapter-knex", "@keystone-alpha/fields"]
},
{
"name": "@keystone-alpha/fields-wysiwyg-tinymce",
"type": "patch",
"dependencies": ["@keystone-alpha/fields"]
},
{
"name": "@keystone-alpha/keystone",
"type": "patch",
"dependencies": ["@keystone-alpha/fields"]
},
{
"name": "@keystone-alpha/list-plugins",
"type": "patch",
"dependencies": ["@keystone-alpha/fields"]
},
{
"name": "@keystone-alpha/cypress-project-access-control",
"type": "patch",
"dependencies": [
"@keystone-alpha/app-admin-ui",
"@keystone-alpha/auth-password",
"@keystone-alpha/keystone",
"@keystone-alpha/fields"
]
},
{
"name": "@keystone-alpha/cypress-project-client-validation",
"type": "patch",
"dependencies": [
"@keystone-alpha/app-admin-ui",
"@keystone-alpha/keystone",
"@keystone-alpha/fields"
]
},
{
"name": "@keystone-alpha/cypress-project-login",
"type": "patch",
"dependencies": [
"@keystone-alpha/app-admin-ui",
"@keystone-alpha/auth-password",
"@keystone-alpha/keystone",
"@keystone-alpha/list-plugins",
"@keystone-alpha/fields"
]
},
{
"name": "@keystone-alpha/cypress-project-social-login",
"type": "patch",
"dependencies": [
"@keystone-alpha/app-admin-ui",
"@keystone-alpha/auth-passport",
"@keystone-alpha/auth-password",
"@keystone-alpha/keystone",
"@keystone-alpha/fields"
]
}
]
}
8 changes: 8 additions & 0 deletions .changeset/smart-avocados-taste/changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
The `.access` property of Fields is now keyed by `schemaName`. As such, a number of getters have been replaced with methods which take `{ schemaName }`.

* `get gqlOutputFields()` -> `gqlOutputFields({ schemaName })`
* `get gqlOutputFieldResolvers()` -> `gqlOutputFieldResolvers({ schemaName })`
* `get gqlAuxFieldResolvers() -> gqlAuxFieldResolvers({ schemaName })`
* `get gqlAuxQueryResolvers()` -> `gqlAuxQueryResolvers({ schemaName })`
* `get gqlAuxMutationResolvers()` -> `gqlAuxMutationResolvers({ schemaName })`
* `get gqlQueryInputFields()` -> `gqlQueryInputFields({ schemaName })`
89 changes: 89 additions & 0 deletions .changeset/strong-stingrays-doubt/changes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"releases": [{ "name": "@keystone-alpha/keystone", "type": "major" }],
"dependents": [
{
"name": "@keystone-alpha/api-tests",
"type": "patch",
"dependencies": [
"@keystone-alpha/adapter-knex",
"@keystone-alpha/adapter-mongoose",
"@keystone-alpha/test-utils",
"@keystone-alpha/keystone"
]
},
{
"name": "@keystone-alpha/demo-project-blog",
"type": "patch",
"dependencies": ["@keystone-alpha/adapter-mongoose", "@keystone-alpha/keystone"]
},
{
"name": "@keystone-alpha/demo-project-meetup",
"type": "patch",
"dependencies": ["@keystone-alpha/adapter-mongoose", "@keystone-alpha/keystone"]
},
{
"name": "@keystone-alpha/demo-project-todo",
"type": "patch",
"dependencies": ["@keystone-alpha/adapter-mongoose", "@keystone-alpha/keystone"]
},
{
"name": "@keystone-alpha/adapter-knex",
"type": "patch",
"dependencies": ["@keystone-alpha/keystone"]
},
{
"name": "@keystone-alpha/adapter-mongoose",
"type": "patch",
"dependencies": ["@keystone-alpha/keystone"]
},
{
"name": "@keystone-alpha/example-projects-blank",
"type": "patch",
"dependencies": ["@keystone-alpha/adapter-mongoose", "@keystone-alpha/keystone"]
},
{
"name": "@keystone-alpha/example-projects-starter",
"type": "patch",
"dependencies": ["@keystone-alpha/adapter-mongoose", "@keystone-alpha/keystone"]
},
{
"name": "@keystone-alpha/example-projects-todo",
"type": "patch",
"dependencies": ["@keystone-alpha/adapter-mongoose", "@keystone-alpha/keystone"]
},
{
"name": "@keystone-alpha/test-utils",
"type": "patch",
"dependencies": [
"@keystone-alpha/adapter-knex",
"@keystone-alpha/adapter-mongoose",
"@keystone-alpha/keystone"
]
},
{
"name": "@keystone-alpha/cypress-project-access-control",
"type": "patch",
"dependencies": ["@keystone-alpha/adapter-mongoose", "@keystone-alpha/keystone"]
},
{
"name": "@keystone-alpha/cypress-project-basic",
"type": "patch",
"dependencies": ["@keystone-alpha/adapter-mongoose", "@keystone-alpha/keystone"]
},
{
"name": "@keystone-alpha/cypress-project-client-validation",
"type": "patch",
"dependencies": ["@keystone-alpha/adapter-mongoose", "@keystone-alpha/keystone"]
},
{
"name": "@keystone-alpha/cypress-project-login",
"type": "patch",
"dependencies": ["@keystone-alpha/adapter-mongoose", "@keystone-alpha/keystone"]
},
{
"name": "@keystone-alpha/cypress-project-social-login",
"type": "patch",
"dependencies": ["@keystone-alpha/adapter-mongoose", "@keystone-alpha/keystone"]
}
]
}
11 changes: 11 additions & 0 deletions .changeset/strong-stingrays-doubt/changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The `.access` property of Lists is now keyed by `schemaName`. As such, a number of getters and methods have been replaced with methods which take `{ schemaName }`.

* `getGqlTypes()` -> `getGqlTypes({ schemaName })`
* `getGqlQueries()` -> `getGqlQueries({ schemaName })`
* `get gqlFieldResolvers()` -> `gqlFieldResolvers({ schemaName })`
* `get gqlAuxFieldResolvers()` -> `gqlAuxFieldResolvers({ schemaName })`
* `get gqlAuxQueryResolvers()` -> `gqlAuxQueryResolvers({ schemaName })`
* `get gqlAuxMutationResolvers()` -> `gqlAuxMutationResolvers({ schemaName })`
* `getGqlMutations()` -> `getGqlMutations({ schemaName })`
* `get gqlQueryResolvers()` -> `gqlQueryResolvers({ schemaName })`
* `get gqlMutationResolvers()` -> `gqlMutationResolvers({ schemaName })`
8 changes: 4 additions & 4 deletions packages/field-content/src/Implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ export class Content extends Relationship.implementation {
};
}

getGqlAuxTypes(...args) {
return [...super.getGqlAuxTypes(...args), ...this.auxList.getGqlTypes(...args)];
getGqlAuxTypes({ schemaName }) {
return [...super.getGqlAuxTypes({ schemaName }), ...this.auxList.getGqlTypes({ schemaName })];
}

get gqlAuxFieldResolvers() {
return this.auxList.gqlFieldResolvers;
gqlAuxFieldResolvers({ schemaName }) {
return this.auxList.gqlFieldResolvers({ schemaName });
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/fields-auto-increment/src/Implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ export class AutoIncrementImplementation extends Implementation {
: gqlTypeDefault;
}

get gqlOutputFields() {
gqlOutputFields() {
return [`${this.path}: ${this.gqlType}`];
}
get gqlOutputFieldResolvers() {
gqlOutputFieldResolvers() {
return { [`${this.path}`]: item => item[this.path] };
}
get gqlQueryInputFields() {
gqlQueryInputFields() {
return [
...this.equalityInputFields(this.gqlType),
...this.orderingInputFields(this.gqlType),
Expand Down
6 changes: 3 additions & 3 deletions packages/fields-datetime-utc/src/Implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { KnexFieldAdapter } from '@keystone-alpha/adapter-knex';
import { MongooseFieldAdapter } from '@keystone-alpha/adapter-mongoose';

export class DateTimeUtcImplementation extends Implementation {
get gqlOutputFields() {
gqlOutputFields() {
return [`${this.path}: String`];
}
get gqlOutputFieldResolvers() {
gqlOutputFieldResolvers() {
return { [`${this.path}`]: item => item[this.path] && item[this.path].toISOString() };
}
get gqlQueryInputFields() {
gqlQueryInputFields() {
return [
...this.equalityInputFields('String'),
...this.orderingInputFields('String'),
Expand Down
6 changes: 3 additions & 3 deletions packages/fields-mongoid/src/Implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { MongooseFieldAdapter } from '@keystone-alpha/adapter-mongoose';
import { KnexFieldAdapter } from '@keystone-alpha/adapter-knex';

export class MongoIdImplementation extends Implementation {
get gqlOutputFields() {
gqlOutputFields() {
return [`${this.path}: ID`];
}
get gqlOutputFieldResolvers() {
gqlOutputFieldResolvers() {
return { [`${this.path}`]: item => item[this.path] };
}
get gqlQueryInputFields() {
gqlQueryInputFields() {
return [...this.equalityInputFields('ID'), ...this.inInputFields('ID')];
}
get gqlUpdateInputFields() {
Expand Down
Loading

0 comments on commit 89c0d7e

Please sign in to comment.