-
-
Notifications
You must be signed in to change notification settings - Fork 468
Hi, I have the following input on creating an order and assigning either a logged in user or creating one and then logging in. How can I achieve this and how can I validate that at least 1 rule is met (logged in or passed data about a new customer)
input OrderInput {
customer: CustomerInput @create
orderItems: [OrderItemInput!]! @create
}
input CustomerInput {
first_name: String! @rules(apply: ["required"])
last_name: String! @rules(apply: ["required"])
email: String!
@rules(
apply: [
"unique:App\\Models\\Customer,email"
"email:rfc,dns"
"required"
]
)
phone: String! @rules(apply: ["required", "phone"])
}
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment