-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,102 additions
and
763 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { config } from '@keystone-6/core' | ||
import { lists } from './schema' | ||
|
||
export default config({ | ||
db: { | ||
provider: 'sqlite', | ||
url: process.env.DATABASE_URL || 'file:./keystone-example.db', | ||
|
||
// WARNING: this is only needed for our monorepo examples, dont do this | ||
prismaClientPath: 'node_modules/myprisma', | ||
}, | ||
lists, | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "@keystone-6/example-number-fields", | ||
"version": null, | ||
"private": true, | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "keystone dev", | ||
"start": "keystone start", | ||
"build": "keystone build", | ||
"postinstall": "keystone postinstall" | ||
}, | ||
"dependencies": { | ||
"@keystone-6/core": "^6.3.1", | ||
"@prisma/client": "5.19.0" | ||
}, | ||
"devDependencies": { | ||
"prisma": "5.19.0", | ||
"typescript": "^5.5.0" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"template": "node", | ||
"container": { | ||
"startScript": "keystone dev", | ||
"node": "20" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,253 @@ | ||
# This file is automatically generated by Keystone, do not modify it manually. | ||
# Modify your Keystone config when you want to change this. | ||
|
||
type Example { | ||
id: ID! | ||
bigInt: BigInt | ||
float: Float | ||
integer: Int | ||
} | ||
|
||
scalar BigInt | ||
|
||
input ExampleWhereUniqueInput { | ||
id: ID | ||
} | ||
|
||
input ExampleWhereInput { | ||
AND: [ExampleWhereInput!] | ||
OR: [ExampleWhereInput!] | ||
NOT: [ExampleWhereInput!] | ||
id: IDFilter | ||
bigInt: BigIntNullableFilter | ||
float: FloatNullableFilter | ||
integer: IntNullableFilter | ||
} | ||
|
||
input IDFilter { | ||
equals: ID | ||
in: [ID!] | ||
notIn: [ID!] | ||
lt: ID | ||
lte: ID | ||
gt: ID | ||
gte: ID | ||
not: IDFilter | ||
} | ||
|
||
input BigIntNullableFilter { | ||
equals: BigInt | ||
in: [BigInt!] | ||
notIn: [BigInt!] | ||
lt: BigInt | ||
lte: BigInt | ||
gt: BigInt | ||
gte: BigInt | ||
not: BigIntNullableFilter | ||
} | ||
|
||
input FloatNullableFilter { | ||
equals: Float | ||
in: [Float!] | ||
notIn: [Float!] | ||
lt: Float | ||
lte: Float | ||
gt: Float | ||
gte: Float | ||
not: FloatNullableFilter | ||
} | ||
|
||
input IntNullableFilter { | ||
equals: Int | ||
in: [Int!] | ||
notIn: [Int!] | ||
lt: Int | ||
lte: Int | ||
gt: Int | ||
gte: Int | ||
not: IntNullableFilter | ||
} | ||
|
||
input ExampleOrderByInput { | ||
id: OrderDirection | ||
bigInt: OrderDirection | ||
float: OrderDirection | ||
integer: OrderDirection | ||
} | ||
|
||
enum OrderDirection { | ||
asc | ||
desc | ||
} | ||
|
||
input ExampleUpdateInput { | ||
bigInt: BigInt | ||
float: Float | ||
integer: Int | ||
} | ||
|
||
input ExampleUpdateArgs { | ||
where: ExampleWhereUniqueInput! | ||
data: ExampleUpdateInput! | ||
} | ||
|
||
input ExampleCreateInput { | ||
bigInt: BigInt | ||
float: Float | ||
integer: Int | ||
} | ||
|
||
""" | ||
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). | ||
""" | ||
scalar JSON @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf") | ||
|
||
type Mutation { | ||
createExample(data: ExampleCreateInput!): Example | ||
createExamples(data: [ExampleCreateInput!]!): [Example] | ||
updateExample(where: ExampleWhereUniqueInput!, data: ExampleUpdateInput!): Example | ||
updateExamples(data: [ExampleUpdateArgs!]!): [Example] | ||
deleteExample(where: ExampleWhereUniqueInput!): Example | ||
deleteExamples(where: [ExampleWhereUniqueInput!]!): [Example] | ||
} | ||
|
||
type Query { | ||
example(where: ExampleWhereUniqueInput!): Example | ||
examples(where: ExampleWhereInput! = {}, orderBy: [ExampleOrderByInput!]! = [], take: Int, skip: Int! = 0, cursor: ExampleWhereUniqueInput): [Example!] | ||
examplesCount(where: ExampleWhereInput! = {}): Int | ||
keystone: KeystoneMeta! | ||
} | ||
|
||
type KeystoneMeta { | ||
adminMeta: KeystoneAdminMeta! | ||
} | ||
|
||
type KeystoneAdminMeta { | ||
lists: [KeystoneAdminUIListMeta!]! | ||
list(key: String!): KeystoneAdminUIListMeta | ||
} | ||
|
||
type KeystoneAdminUIListMeta { | ||
key: String! | ||
path: String! | ||
description: String | ||
label: String! | ||
labelField: String! | ||
singular: String! | ||
plural: String! | ||
fields: [KeystoneAdminUIFieldMeta!]! | ||
groups: [KeystoneAdminUIFieldGroupMeta!]! | ||
graphql: KeystoneAdminUIGraphQL! | ||
pageSize: Int! | ||
initialColumns: [String!]! | ||
initialSearchFields: [String!]! | ||
initialSort: KeystoneAdminUISort | ||
isSingleton: Boolean! | ||
hideNavigation: Boolean! | ||
hideCreate: Boolean! | ||
hideDelete: Boolean! | ||
} | ||
|
||
type KeystoneAdminUIFieldMeta { | ||
path: String! | ||
label: String! | ||
description: String | ||
isOrderable: Boolean! | ||
isFilterable: Boolean! | ||
isNonNull: [KeystoneAdminUIFieldMetaIsNonNull!] | ||
fieldMeta: JSON | ||
viewsIndex: Int! | ||
customViewsIndex: Int | ||
createView: KeystoneAdminUIFieldMetaCreateView! | ||
listView: KeystoneAdminUIFieldMetaListView! | ||
itemView(id: ID): KeystoneAdminUIFieldMetaItemView | ||
search: QueryMode | ||
} | ||
|
||
enum KeystoneAdminUIFieldMetaIsNonNull { | ||
read | ||
create | ||
update | ||
} | ||
|
||
type KeystoneAdminUIFieldMetaCreateView { | ||
fieldMode: KeystoneAdminUIFieldMetaCreateViewFieldMode! | ||
} | ||
|
||
enum KeystoneAdminUIFieldMetaCreateViewFieldMode { | ||
edit | ||
hidden | ||
} | ||
|
||
type KeystoneAdminUIFieldMetaListView { | ||
fieldMode: KeystoneAdminUIFieldMetaListViewFieldMode! | ||
} | ||
|
||
enum KeystoneAdminUIFieldMetaListViewFieldMode { | ||
read | ||
hidden | ||
} | ||
|
||
type KeystoneAdminUIFieldMetaItemView { | ||
fieldMode: KeystoneAdminUIFieldMetaItemViewFieldMode | ||
fieldPosition: KeystoneAdminUIFieldMetaItemViewFieldPosition | ||
} | ||
|
||
enum KeystoneAdminUIFieldMetaItemViewFieldMode { | ||
edit | ||
read | ||
hidden | ||
} | ||
|
||
enum KeystoneAdminUIFieldMetaItemViewFieldPosition { | ||
form | ||
sidebar | ||
} | ||
|
||
enum QueryMode { | ||
default | ||
insensitive | ||
} | ||
|
||
type KeystoneAdminUIFieldGroupMeta { | ||
label: String! | ||
description: String | ||
fields: [KeystoneAdminUIFieldMeta!]! | ||
} | ||
|
||
type KeystoneAdminUIGraphQL { | ||
names: KeystoneAdminUIGraphQLNames! | ||
} | ||
|
||
type KeystoneAdminUIGraphQLNames { | ||
outputTypeName: String! | ||
whereInputName: String! | ||
whereUniqueInputName: String! | ||
createInputName: String! | ||
createMutationName: String! | ||
createManyMutationName: String! | ||
relateToOneForCreateInputName: String! | ||
relateToManyForCreateInputName: String! | ||
itemQueryName: String! | ||
listOrderName: String! | ||
listQueryCountName: String! | ||
listQueryName: String! | ||
updateInputName: String! | ||
updateMutationName: String! | ||
updateManyInputName: String! | ||
updateManyMutationName: String! | ||
relateToOneForUpdateInputName: String! | ||
relateToManyForUpdateInputName: String! | ||
deleteMutationName: String! | ||
deleteManyMutationName: String! | ||
} | ||
|
||
type KeystoneAdminUISort { | ||
field: String! | ||
direction: KeystoneAdminUISortDirection! | ||
} | ||
|
||
enum KeystoneAdminUISortDirection { | ||
ASC | ||
DESC | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// This file is automatically generated by Keystone, do not modify it manually. | ||
// Modify your Keystone config when you want to change this. | ||
|
||
datasource sqlite { | ||
url = env("DATABASE_URL") | ||
shadowDatabaseUrl = env("SHADOW_DATABASE_URL") | ||
provider = "sqlite" | ||
} | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
output = "node_modules/myprisma" | ||
} | ||
|
||
model Example { | ||
id String @id @default(cuid()) | ||
bigInt BigInt? | ||
float Float? | ||
integer Int? | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { list } from '@keystone-6/core' | ||
import { | ||
bigInt, | ||
float, | ||
integer | ||
} from '@keystone-6/core/fields' | ||
import { allowAll } from '@keystone-6/core/access' | ||
import type { Lists } from '.keystone/types' | ||
|
||
export const lists = { | ||
Example: list({ | ||
access: allowAll, | ||
fields: { | ||
bigInt: bigInt(), | ||
float: float(), | ||
integer: integer(), | ||
}, | ||
}), | ||
} satisfies Lists |
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.