Felipe Paz
07/31/2022, 10:38 AMpublishedAt and it should have the same value that the field createdAt. I tried publishedAt: DateTime! @default(now()), publishedAt: DateTime! @default(value: "now()") , publishedAt: DateTime! @default(value: Date.now()), publishedAt: DateTime! @default(@createdAt) and none of this options worked as expected. Is there a possibility to create a DateTime field with a default value without being the createdAt and UpdatedAt fields?Michael Jay
07/31/2022, 2:55 PMDateTime!, I get a message Fields are required by default. '!' is not longer required.
I've never had any problem with publishedAt DateTime @default(now()) - could it be your ! that's causing the issue?Michael Jay
07/31/2022, 3:01 PM: after your field declaration. In version 3, "field declarations don't require a : "Felipe Paz
07/31/2022, 5:03 PM1.34.8. I think another important thing to say it's the DateTime is a scalar type. Could this affect the default value? So, basically, I have this:
type Workout {
...
@scalarList(strategy: RELATION)
publishedAt: DateTime @default(now())
...
}
scalar DateTimeFelipe Paz
07/31/2022, 5:07 PMERROR: Syntax error while parsing GraphQL query. Invalid input "RELATION)\n publishedAt: DateTime @default(now(", expected Value, Argument, Directive or FieldDefinition (line 121, column 49):
spotifyUris: [String!]! @scalarList(strategy: RELATION)
^
{
"data": {
"deploy": null
},
"errors": [
{
"locations": [
{
"line": 2,
"column": 9
}
],
"path": [
"deploy"
],
"code": 3017,
"message": "Syntax error while parsing GraphQL query. Invalid input \"RELATION)\\n publishedAt: DateTime @default(now(\", expected Value, Argument, Directive or FieldDefinition (line 121, column 49):\n spotifyUris: [String!]! @scalarList(strategy: RELATION)\n ^",
"requestId": "local:cl69keufr000s0868zjm14ldx"
}
],
"status": 200
}Michael Jay
07/31/2022, 9:00 PMNurul
08/01/2022, 6:01 AM