0

I am creating my first Hasura Action and got stuck.

While I do think there team have done great job in documentation, I am having tough time in comprehending few things.

First, what is this !? in say this login (username: String!, password: String!): LoginResponse

Second, Suppose this is my typeconfiguration

input validateDriverTlcNumberInput {
  driverName: String!
  tlcNumber: Boolean!
}

type validateDriverTlcNumberOutput {
  valid: Boolean!
  message:String!
}

if valid is true then there would be no message but if valid is false, then there would be message explaining what went wrong?

How should I define my output?

Rahul Patel
  • 63
  • 1
  • 11

1 Answers1

1

In graphql all types are nullable, adding ! makes a type non-null that being said you can define the output type as this so the message can be nullable

type validateDriverTlcNumberOutput {
  valid: Boolean!
  message:String
}
Abdullah Saleem
  • 3,701
  • 1
  • 19
  • 30