neo4j-graphql-js
neo4j-graphql-js copied to clipboard
Field Default Value
The @defaultValue constraint as shown below is not yet supported.
type Story { name: String isPublished: Boolean @defaultValue(value: "false") }
Computed @defaultValue constraint will be very cool to see as in the example below.
type Story { name: String isPublished: Boolean @defaultValue(value: "false") createdAt: DateTime @defaultValue(value: @cypher(statement:"RETURN datetime()) }
That would be relly awesome!!! I tried it by using third party directives but sadly they have no effect at all. Is there a reason why my directives might not work?
@appinteractive - which third party directives were you trying? There's nothing specific to neo4j-graphql.js that would prevent directives from working as expected.
Bump - very useful for common use cases - please implement <3
Yes please
Just @default: value or @default(value) is enough syntax, surely.
Also, I agree such a constraint would be a boon, but given that no such function exists in cypher let alone in the GraphQL spec, it's a bit unfair to say "it's not yet supported".
https://github.com/neo4j-graphql/neo4j-graphql-js/issues/608