Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
timleslie committed Sep 25, 2020
1 parent 1f89066 commit cc5c6f5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 20 deletions.
11 changes: 8 additions & 3 deletions docs/guides/intro-to-graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ The options available in a where clause depend on the field types.

```graphql
query {
allUsers(where: { name_starts_with_i: "A" }) {
allUsers (where: { name_starts_with_i: "A"} ) {
id
}
}
Expand Down Expand Up @@ -301,7 +301,12 @@ You can combine multiple where clauses with `AND` or `OR` operators.

```graphql
query {
allUsers(where: { OR: [{ name_starts_with_i: "A" }, { email_starts_with_i: "A" }] }) {
allUsers (where: {
OR: [
{ name_starts_with_i: "A" },
{ email_starts_with_i: "A" },
]
} ) {
id
}
}
Expand Down Expand Up @@ -394,7 +399,7 @@ It is important to provide the same `where` and `search` arguments to both the `

```graphql
query {
allUsers(search: "a", skip: 10, first: 10) {
allUsers (search: "a", skip: 10, first: 10) {
id
}
_allUsersMeta(search: "a") {
Expand Down
13 changes: 2 additions & 11 deletions examples/todo/index.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
const { Keystone } = require('@keystonejs/keystone');
const { PrismaAdapter } = require('@keystonejs/adapter-prisma');
const { MongooseAdapter } = require('@keystonejs/adapter-mongoose');
const { Text } = require('@keystonejs/fields');
const { GraphQLApp } = require('@keystonejs/app-graphql');
const { AdminUIApp } = require('@keystonejs/app-admin-ui');
const { StaticApp } = require('@keystonejs/app-static');

const keystone = new Keystone({
adapter: new PrismaAdapter({
url: 'postgres://keystone5:k3yst0n3@localhost:5432/keystone',
getDbSchemaName: () => 'test_schema',
}),
cookieSecret: 'shutup',
adapter: new MongooseAdapter({ mongoUri: 'mongodb://localhost/todo' }),
});

keystone.createList('Todo', {
schemaDoc: 'A list of things which need to be done',
fields: {
name: { type: Text, schemaDoc: 'This is the thing you need to do', isRequired: true },
other: { type: Text },
more: { type: Text },
aha: { type: Text },
asdfasd: { type: Text },
ertq: { type: Text },
},
});

Expand Down
2 changes: 1 addition & 1 deletion examples/todo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"start": "cross-env NODE_ENV=production keystone start"
},
"dependencies": {
"@keystonejs/adapter-prisma": "^0.0.0",
"@keystonejs/adapter-mongoose": "^9.0.7",
"@keystonejs/app-admin-ui": "^7.3.6",
"@keystonejs/app-graphql": "^6.1.3",
"@keystonejs/app-static": "^5.1.3",
Expand Down
10 changes: 5 additions & 5 deletions packages-next/fields/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ The current `DateTimeUtc` type; a point in time; effectively a datetime at UTC a

## Timezone

Basically a preconfigured select. See <https://github.com/keystonejs/keystone/issues/2937>
Basically a preconfigured select. See https://github.com/keystonejs/keystone/issues/2937

- [ ] Add Timezone Field
- [ ] Allow formatting date input in the field resolver (see <https://date-fns.org/v2.0.0-alpha.27/docs/Time-Zones>)
- [ ] Allow formatting date input in the field resolver (see https://date-fns.org/v2.0.0-alpha.27/docs/Time-Zones)

## LocalDateTime

Combines both Timestamp and Timezone into a single field. See <https://github.com/keystonejs/keystone/issues/2938>
Combines both Timestamp and Timezone into a single field. See https://github.com/keystonejs/keystone/issues/2938

- [ ] Add a LocalDateTime field type
- [ ] Allow formatting the date in the field resolver (see <https://date-fns.org/v2.0.0-alpha.27/docs/Time-Zones>)
- [ ] Allow formatting the date in the field resolver (see https://date-fns.org/v2.0.0-alpha.27/docs/Time-Zones)

## CalendarDay

Expand All @@ -47,7 +47,7 @@ New field type for storing a time of day.

> It would be nice to capture the intent of "this time of day, every day, regardless of time zone or offset" in a type.
> I imagine we'd store it as per the time part of an ISO 8601 string (ie. HH:mm:ss.nnn) with millisecond precision.
> <https://github.com/keystonejs/keystone/issues/46#issuecomment-413743564>
> https://github.com/keystonejs/keystone/issues/46#issuecomment-413743564
- [ ] Write up the spec in an issue
- [ ] Add a Time field type

0 comments on commit cc5c6f5

Please sign in to comment.