Skip to content

Instantly share code, notes, and snippets.

@steebchen
Created December 3, 2019 12:52
Show Gist options
  • Save steebchen/d3119429162e28be15b407a59bb51037 to your computer and use it in GitHub Desktop.
Save steebchen/d3119429162e28be15b407a59bb51037 to your computer and use it in GitHub Desktop.
localhost/user
localhost/user?name[equals]=stuff
localhost/user?name[contains]=stuff
func (r UserResolver) User(ctx context.Context, input UserFilterInput) (User, error) {
  query := User.Query()
  
  user, err := r.client.User.FindOne(
    User.Name.MaybeEquals(input.Name.Equals),
    User.Name.MaybeContains(input.Name.Contains),
  ).Exec(ctx)
  return user, err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment