Skip to content

Parse date as GraphQLDate instead of GraphQLString #36

Description

@alexey-sh

For example,

// schema.ts
  updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow()

in GQL response

            "updatedAt": "1748179197314"

I believe timestamp milliseconds inside string is not an appropriate result for a datetime columns.

// src/util/type-converter/index.ts#L75
		case 'date':
			return { type: GraphQLString, description: 'Date' };

https://github.com/drizzle-team/drizzle-graphql/blob/main/src/util/type-converter/index.ts#L75

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions