Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/auto-ef54ba0af9d06c7b.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vyrel/morph": minor
---

remove some non necessary params
27 changes: 23 additions & 4 deletions apps/docs/content/docs/public-packages/morph/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ Creates a bridge bound to one Pothos builder.
| Option | Purpose |
| --- | --- |
| `defaultIdFields` | Field names exposed as GraphQL `ID`; model options can override them |
| `defaultEnumName` | Naming strategy for enums generated from a model field |
| `scalarTypes` | Additional named input/scalar types available to mappings |
| `unmappedFields` | Default `throw`, `warn`, or `omit` behavior |
| `unmappedFields` | Optional mapping failure policy (`throw` by default, or `warn` / `omit`) |

Built-in GraphQL input names and scalar types already registered on the builder
are discovered during initialization.
are discovered during initialization. Generated enum names default to
`` `${objectName}${PascalCase(field)}` ``; override per model with `enumName`.

The returned bridge exposes `model`, the equivalent `fields` alias, and a
bridge-level `inputsFrom` helper.
Expand Down Expand Up @@ -44,10 +43,28 @@ bridge-level `inputsFrom` helper.
| `argsFrom(schema, options?)` | Typed Pothos query argument map |
| `computedEnumField(t, field, options)` | One resolver-backed enum field |
| `args` | Named pre-built args when `listArgsSchema` is configured |
| `connection({ type, ... })` | Forward-cursor Connection + PageInfo object refs |

### `model.connection(options)`

Call after the node object exists:

```ts
const TaskConnection = taskGraphql.connection({ type: TaskObject });
```

Defaults: `` `${objectName}Connection` `` / `` `${objectName}PageInfo` `` with
`nodes` and `{ endCursor, hasNextPage }`. Pass `fields` to extend the
Connection. Export types `ConnectionPayload` / `ConnectionPageInfo` for
service return shapes. This is not full Relay (`edges` / bi-directional
PageInfo).

Input/argument options support `exclude`, `fieldTypes`, `required`, and
`unmappedFields`. Model-derived helpers also receive the model's enum registry.

`z.array(z.string())` and `z.array(z.enum(...))` map to GraphQL lists
automatically when enums are already on the builder.

## Automatic mapping

| Zod field | GraphQL mapping |
Expand All @@ -58,6 +75,8 @@ Input/argument options support `exclude`, `fieldTypes`, `required`, and
| other `z.number()` | `Float` |
| `z.date()` | `DateTime` |
| `z.enum()` / supported literals | Registered GraphQL enum |
| `z.array(z.string())` | `[String]` |
| `z.array(z.enum(...))` | `[Enum]` when values match a builder enum |
| Optional or nullable wrapper | Nullable GraphQL field |
| `.describe()` | GraphQL description |

Expand Down
1 change: 0 additions & 1 deletion apps/docs/content/docs/public-packages/morph/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const builder = new SchemaBuilder({

const bridge = initializeDrizzleGraphqlBridge(builder, {
defaultIdFields: ["id"],
unmappedFields: "throw",
});

const userSchema = z.object({
Expand Down
8 changes: 4 additions & 4 deletions apps/extension/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ input CreateTask {
dueDate: LocalDate
image: File
labelIds: [String!]
organizationId: String!
organizationId: ID!
priority: TaskPriority
status: TaskStatus
title: String!
Expand All @@ -15,7 +15,7 @@ input CreateTask {
input CreateTaskLabel {
color: String!
name: String!
organizationId: String!
organizationId: ID!
}

"""
Expand Down Expand Up @@ -117,7 +117,7 @@ type Task {
imageFull: String
imageThumb: String
labels: [TaskLabel!]!
organizationId: String!
organizationId: ID!
priority: TaskPriority!
status: TaskStatus!
title: String!
Expand All @@ -135,7 +135,7 @@ type TaskLabel {
createdAt: DateTime!
id: ID!
name: String!
organizationId: String!
organizationId: ID!
}

type TaskPageInfo {
Expand Down
8 changes: 4 additions & 4 deletions apps/mobile/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ input CreateTask {
dueDate: LocalDate
image: File
labelIds: [String!]
organizationId: String!
organizationId: ID!
priority: TaskPriority
status: TaskStatus
title: String!
Expand All @@ -15,7 +15,7 @@ input CreateTask {
input CreateTaskLabel {
color: String!
name: String!
organizationId: String!
organizationId: ID!
}

"""
Expand Down Expand Up @@ -117,7 +117,7 @@ type Task {
imageFull: String
imageThumb: String
labels: [TaskLabel!]!
organizationId: String!
organizationId: ID!
priority: TaskPriority!
status: TaskStatus!
title: String!
Expand All @@ -135,7 +135,7 @@ type TaskLabel {
createdAt: DateTime!
id: ID!
name: String!
organizationId: String!
organizationId: ID!
}

type TaskPageInfo {
Expand Down
8 changes: 4 additions & 4 deletions apps/web/graphql-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

export type introspection_types = {
'Boolean': unknown;
'CreateTask': { kind: 'INPUT_OBJECT'; name: 'CreateTask'; isOneOf: false; inputFields: [{ name: 'assigneeId'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'dueDate'; type: { kind: 'SCALAR'; name: 'LocalDate'; ofType: null; }; defaultValue: null }, { name: 'image'; type: { kind: 'SCALAR'; name: 'File'; ofType: null; }; defaultValue: null }, { name: 'labelIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; defaultValue: null }, { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'priority'; type: { kind: 'ENUM'; name: 'TaskPriority'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'ENUM'; name: 'TaskStatus'; ofType: null; }; defaultValue: null }, { name: 'title'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; };
'CreateTaskLabel': { kind: 'INPUT_OBJECT'; name: 'CreateTaskLabel'; isOneOf: false; inputFields: [{ name: 'color'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; };
'CreateTask': { kind: 'INPUT_OBJECT'; name: 'CreateTask'; isOneOf: false; inputFields: [{ name: 'assigneeId'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'dueDate'; type: { kind: 'SCALAR'; name: 'LocalDate'; ofType: null; }; defaultValue: null }, { name: 'image'; type: { kind: 'SCALAR'; name: 'File'; ofType: null; }; defaultValue: null }, { name: 'labelIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; }; defaultValue: null }, { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'priority'; type: { kind: 'ENUM'; name: 'TaskPriority'; ofType: null; }; defaultValue: null }, { name: 'status'; type: { kind: 'ENUM'; name: 'TaskStatus'; ofType: null; }; defaultValue: null }, { name: 'title'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; };
'CreateTaskLabel': { kind: 'INPUT_OBJECT'; name: 'CreateTaskLabel'; isOneOf: false; inputFields: [{ name: 'color'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }]; };
'DateTime': unknown;
'DeleteOrganization': { kind: 'INPUT_OBJECT'; name: 'DeleteOrganization'; isOneOf: false; inputFields: [{ name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; };
'DeleteTask': { kind: 'INPUT_OBJECT'; name: 'DeleteTask'; isOneOf: false; inputFields: [{ name: 'taskId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; };
Expand All @@ -19,9 +19,9 @@ export type introspection_types = {
'Organization': { kind: 'OBJECT'; name: 'Organization'; fields: { 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'imageFull': { name: 'imageFull'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'imageThumb': { name: 'imageThumb'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'logo': { name: 'logo'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'metadata': { name: 'metadata'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'slug': { name: 'slug'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
'Query': { kind: 'OBJECT'; name: 'Query'; fields: { 'health': { name: 'health'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'organization': { name: 'organization'; type: { kind: 'OBJECT'; name: 'Organization'; ofType: null; } }; 'organizations': { name: 'organizations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Organization'; ofType: null; }; }; }; } }; 'task': { name: 'task'; type: { kind: 'OBJECT'; name: 'Task'; ofType: null; } }; 'taskConnection': { name: 'taskConnection'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TaskConnection'; ofType: null; }; } }; 'taskLabels': { name: 'taskLabels'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TaskLabel'; ofType: null; }; }; }; } }; 'taskSummary': { name: 'taskSummary'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TaskSummary'; ofType: null; }; } }; 'tasks': { name: 'tasks'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Task'; ofType: null; }; }; }; } }; 'user': { name: 'user'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; }; };
'String': unknown;
'Task': { kind: 'OBJECT'; name: 'Task'; fields: { 'assignee': { name: 'assignee'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'assigneeId': { name: 'assigneeId'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'createdById': { name: 'createdById'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'dueDate': { name: 'dueDate'; type: { kind: 'SCALAR'; name: 'LocalDate'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'imageFull': { name: 'imageFull'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'imageThumb': { name: 'imageThumb'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'labels': { name: 'labels'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TaskLabel'; ofType: null; }; }; }; } }; 'organizationId': { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'priority': { name: 'priority'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'TaskPriority'; ofType: null; }; } }; 'status': { name: 'status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'TaskStatus'; ofType: null; }; } }; 'title': { name: 'title'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; }; };
'Task': { kind: 'OBJECT'; name: 'Task'; fields: { 'assignee': { name: 'assignee'; type: { kind: 'OBJECT'; name: 'User'; ofType: null; } }; 'assigneeId': { name: 'assigneeId'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'createdById': { name: 'createdById'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'description': { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'dueDate': { name: 'dueDate'; type: { kind: 'SCALAR'; name: 'LocalDate'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'imageFull': { name: 'imageFull'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'imageThumb': { name: 'imageThumb'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'labels': { name: 'labels'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TaskLabel'; ofType: null; }; }; }; } }; 'organizationId': { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'priority': { name: 'priority'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'TaskPriority'; ofType: null; }; } }; 'status': { name: 'status'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'TaskStatus'; ofType: null; }; } }; 'title': { name: 'title'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; }; };
'TaskConnection': { kind: 'OBJECT'; name: 'TaskConnection'; fields: { 'nodes': { name: 'nodes'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Task'; ofType: null; }; }; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TaskPageInfo'; ofType: null; }; } }; }; };
'TaskLabel': { kind: 'OBJECT'; name: 'TaskLabel'; fields: { 'color': { name: 'color'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'organizationId': { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
'TaskLabel': { kind: 'OBJECT'; name: 'TaskLabel'; fields: { 'color': { name: 'color'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'organizationId': { name: 'organizationId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; }; };
'TaskPageInfo': { kind: 'OBJECT'; name: 'TaskPageInfo'; fields: { 'endCursor': { name: 'endCursor'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'hasNextPage': { name: 'hasNextPage'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; }; };
'TaskPriority': { name: 'TaskPriority'; enumValues: 'HIGH' | 'LOW' | 'MEDIUM' | 'NONE'; };
'TaskSort': { name: 'TaskSort'; enumValues: 'DUE_DATE' | 'NEWEST' | 'PRIORITY' | 'RECENTLY_UPDATED'; };
Expand Down
8 changes: 4 additions & 4 deletions apps/web/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ input CreateTask {
dueDate: LocalDate
image: File
labelIds: [String!]
organizationId: String!
organizationId: ID!
priority: TaskPriority
status: TaskStatus
title: String!
Expand All @@ -15,7 +15,7 @@ input CreateTask {
input CreateTaskLabel {
color: String!
name: String!
organizationId: String!
organizationId: ID!
}

"""
Expand Down Expand Up @@ -117,7 +117,7 @@ type Task {
imageFull: String
imageThumb: String
labels: [TaskLabel!]!
organizationId: String!
organizationId: ID!
priority: TaskPriority!
status: TaskStatus!
title: String!
Expand All @@ -135,7 +135,7 @@ type TaskLabel {
createdAt: DateTime!
id: ID!
name: String!
organizationId: String!
organizationId: ID!
}

type TaskPageInfo {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/graphql/generated/client-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ export const graphqlClientSchema = {
"kind": "NON_NULL",
"ofType": {
"kind": "NAMED",
"name": "String"
"name": "ID"
}
}
},
Expand Down Expand Up @@ -465,7 +465,7 @@ export const graphqlClientSchema = {
"kind": "NON_NULL",
"ofType": {
"kind": "NAMED",
"name": "String"
"name": "ID"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@vyrel/env": "workspace:*",
"@vyrel/graphql": "workspace:*",
"@vyrel/logging": "workspace:*",
"@vyrel/morph": "workspace:*",
"@vyrel/storage": "workspace:*",
"better-auth": "catalog:",
"dotenv": "catalog:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { builder } from "@vyrel/graphql/pothos";
import { createTaskLabel } from "../../services/label.service";
import { taskLabelCreateSchema } from "../../types/base.types";
import { runTaskGraphqlEffect } from "../effect";
import { TaskLabelObject, taskLabelGraphql } from "../task.query";
import { TaskLabelObject, taskGraphql } from "../task.query";

builder.mutationFields((t) => ({
createTaskLabel: t.fieldWithInput({
input: {
...taskLabelGraphql.inputsFrom(taskLabelCreateSchema),
...taskGraphql.label.inputsFrom(taskLabelCreateSchema),
},
resolve: (_root, args, context) =>
runTaskGraphqlEffect(
Expand Down
6 changes: 1 addition & 5 deletions packages/api/src/models/task/graphql/mutations/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ const typeOptionsMetadata = {
builder.mutationFields((t) => ({
createTask: t.fieldWithInput({
input: {
...taskGraphql.inputsFrom(taskCreateSchema, {
fieldTypes: {
labelIds: ["String"],
},
}),
...taskGraphql.task.inputsFrom(taskCreateSchema),
},
resolve: (_root, args, context) =>
runTaskGraphqlEffect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { builder } from "@vyrel/graphql/pothos";
import { deleteTaskLabel } from "../../services/label.service";
import { taskLabelDeleteSchema } from "../../types/base.types";
import { runTaskGraphqlEffect } from "../effect";
import { taskLabelGraphql } from "../task.query";
import { taskGraphql } from "../task.query";

builder.mutationFields((t) => ({
deleteTaskLabel: t.fieldWithInput({
input: {
...taskLabelGraphql.inputsFrom(taskLabelDeleteSchema),
...taskGraphql.label.inputsFrom(taskLabelDeleteSchema),
},
resolve: (_root, args, context) =>
runTaskGraphqlEffect(
Expand Down
Loading
Loading