Skip to content

Navigation Menu

Sign in
Sign up

Passing the id of the authorized user or the id of the newly created user #2635

Unanswered
tandler5 asked this question in Q&A
Discussion options

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"])
}
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /