Skip to content

Commit

Permalink
feat: implement fully dynamic crud
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Jan 2, 2021
1 parent e67157f commit 4ff8e54
Show file tree
Hide file tree
Showing 54 changed files with 4,136 additions and 154 deletions.
11 changes: 11 additions & 0 deletions api-schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ type MetaModel {
id: String
}

type MetaModelData {
count: Int
data: [JSON!]
model: MetaModel
schema: MetaSchema
}

type MetaSchema {
enums: [MetaEnum!]
models: [MetaModel!]
Expand All @@ -51,11 +58,15 @@ type Mutation {
intercomPub(payload: JSON, scope: String, type: String!): IntercomMessage
login(input: LoginInput!): UserToken
logout: Boolean
metaCreateModelData(data: JSON!, model: String!): JSON
metaDeleteModelRecord(model: String!, recordId: String!): JSON
register(input: RegisterInput!): UserToken
}

type Query {
me: User
metaGenerated: JSON
metaModelData(model: String!): MetaModelData
metaSchema: MetaSchema
uptime: Float
}
Expand Down
198 changes: 198 additions & 0 deletions graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,83 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "MetaModelData",
"description": null,
"fields": [
{
"name": "count",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "data",
"description": null,
"args": [],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "JSON",
"ofType": null
}
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "model",
"description": null,
"args": [],
"type": {
"kind": "OBJECT",
"name": "MetaModel",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "schema",
"description": null,
"args": [],
"type": {
"kind": "OBJECT",
"name": "MetaSchema",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "SCALAR",
"name": "Int",
"description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "MetaSchema",
Expand Down Expand Up @@ -447,6 +524,88 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "metaCreateModelData",
"description": null,
"args": [
{
"name": "data",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "JSON",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "model",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null
}
],
"type": {
"kind": "SCALAR",
"name": "JSON",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "metaDeleteModelRecord",
"description": null,
"args": [
{
"name": "model",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null
},
{
"name": "recordId",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null
}
],
"type": {
"kind": "SCALAR",
"name": "JSON",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "register",
"description": null,
Expand Down Expand Up @@ -497,6 +656,45 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "metaGenerated",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "JSON",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "metaModelData",
"description": null,
"args": [
{
"name": "model",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null
}
],
"type": {
"kind": "OBJECT",
"name": "MetaModelData",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "metaSchema",
"description": null,
Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ module.exports = {
'<rootDir>/libs/web/meta/feature',
'<rootDir>/libs/web/meta/data-access',
'<rootDir>/libs/web/meta/ui',
'<rootDir>/libs/prisma/generator',
],
}
1 change: 1 addition & 0 deletions libs/api/core/data-access/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './lib/api-core-data-access.module'
export * from './lib/api-core-data-access.service'
export * from './prisma/nx-prisma/index'
Loading

0 comments on commit 4ff8e54

Please sign in to comment.