Skip to content

Commit

Permalink
updateSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbrui committed Nov 3, 2023
1 parent 49b23ec commit 0844869
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 70 deletions.
2 changes: 1 addition & 1 deletion packages/integrations/gei-crud/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gei-crud",
"version": "0.8.9",
"version": "0.9.0",
"description": "GraphQL Editor integration for stucco. Allows basic crud operations and relations.",
"main": "lib/index.js",
"private": false,
Expand Down
153 changes: 84 additions & 69 deletions packages/integrations/gei-crud/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,94 +1,109 @@
type Object {
name: String!
content: String
oneToOne(info: DataInput): Object
oneToMany(info: DataInput): [Object]
_id: String!
createdAt: String
updatedAt: String
type Object{
name: String!
content: String
oneToOne(
data: DataInput
): Object
oneToMany(
data: DataInput
): [Object]
_id: String!
createdAt: String
updatedAt: String
}

type Query {
objects(
info: DataInput
fieldFilter: FieldFilterInput
fieldRegexFilter: FieldFilterInput
dateFilter: DateFilterInput
sortByField: SortInput
): [Object!]
oneById(info: DataInput, _id: String!): Object
type Query{
objects(
data: DataInput
fieldFilter: FieldFilterInput
fieldRegexFilter: FieldFilterInput
dateFilter: DateFilterInput
sortByField: SortInput
): [Object!]
oneById(
data: DataInput
_id: String!
): Object
}

type Mutation {
create(info: DataInput, object: Update!): String
update(info: DataInput, _id: String, object: Update!): Boolean
delete(info: DataInput, _id: String): Boolean
type Mutation{
create(
data: DataInput
object: Update!
): String
update(
data: DataInput
_id: String
object: Update!
): Boolean
delete(
data: DataInput
_id: String
): Boolean
}

input DataInput {
model: String
sourceParameters: [String]
related: [ReladedInput]
addFields: [AddFieldsInput]
input DataInput{
model: String
sourceParameters: [String]
related: [ReladedInput]
addFields: [AddFieldsInput]
}

input AddFieldsInput {
name: String!
value: Anything
input AddFieldsInput{
name: String!
value: String
}

input ReladedInput {
model: String!
field: String
input ReladedInput{
model: String!
field: String
}

input Create {
name: String!
content: String
owner: String
input Create{
name: String!
content: String
owner: String
}

input FieldFilterInput {
name: String
content: String
owner: String
customFieldName: String
input FieldFilterInput{
name: String
content: String
owner: String
customFieldName: String
}

input SortInput {
field: SortField!
"""
True for ASC, false for DESC
"""
order: Boolean
input SortInput{
field: SortField!
"""
True for ASC, false for DESC
"""
order: Boolean
}

input DateFilterInput {
"""
Basicly filter use createdAt,
but you can to set other field
"""
dateFieldName: String
from: String
to: String
input DateFilterInput{
"""
Basicly filter use createdAt,
but you can to set other field
"""
dateFieldName: String
from: String
to: String
}

enum SortField {
CREATED_AT
UPDATED_AT
NAME
CUSTOM_FIELD_NAME
enum SortField{
CREATED_AT
UPDATED_AT
NAME
CUSTOM_FIELD_NAME
}

input Update {
name: String
content: String
owner: String
input Update{
name: String
content: String
owner: String
}

scalar Anything

schema {
query: Query
mutation: Mutation
schema{
query: Query
mutation: Mutation
}
3 changes: 3 additions & 0 deletions packages/integrations/gei-users/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
"node-fetch": "^3.3.0",
"stucco-js": "^0.10.18",
"ws": "^8.12.0"
},
"devDependencies": {
"@types/mongodb": "^4.0.7"
}
}

0 comments on commit 0844869

Please sign in to comment.