Skip to content
Discussion options

You must be logged in to vote

In my opinion, all of these proposals add a lot of complexity/magic to the "backend" part. I am very pleased with the look the resolvers have right now, even if they could be more strongly typed:

// app/mutations/updateUser.ts

import { Context } from "blitz"
import { User } from "db"
import { UpdateUserInputType } from "../validations"

export default async function updateUser(input: UpdateUserInputType, ctx: Context): Promise<User> => {
  ctx.session.authorize()
  // ...
}

I like to have my types at the right of the = but we could also provide a Query and Mutation types for those who prefer them at the left:

// app/mutations/updateUser.ts

import { Mutation } from "blitz"
import { User } 

Replies: 9 comments 21 replies

Comment options

You must be logged in to vote
2 replies
@flybayer
Comment options

flybayer Sep 12, 2020
Maintainer Author

@flybayer
Comment options

flybayer Sep 12, 2020
Maintainer Author

Comment options

You must be logged in to vote
2 replies
@flybayer
Comment options

flybayer Sep 12, 2020
Maintainer Author

@HeyGarrison
Comment options

Comment options

You must be logged in to vote
1 reply
@flybayer
Comment options

flybayer Sep 12, 2020
Maintainer Author

Comment options

You must be logged in to vote
1 reply
@ryardley
Comment options

Comment options

flybayer
Sep 12, 2020
Maintainer Author

You must be logged in to vote
3 replies
@HeyGarrison
Comment options

@flybayer
Comment options

flybayer Sep 12, 2020
Maintainer Author

@Skn0tt
Comment options

Comment options

You must be logged in to vote
2 replies
@ryardley
Comment options

@ryardley
Comment options

Comment options

You must be logged in to vote
5 replies
@flybayer
Comment options

flybayer Sep 14, 2020
Maintainer Author

@flybayer
Comment options

flybayer Sep 14, 2020
Maintainer Author

@flybayer
Comment options

flybayer Sep 16, 2020
Maintainer Author

@ryardley
Comment options

@flybayer
Comment options

flybayer Sep 16, 2020
Maintainer Author

Answer selected by flybayer
Comment options

flybayer
Sep 14, 2020
Maintainer Author

You must be logged in to vote
2 replies
@HeyGarrison
Comment options

@flybayer
Comment options

flybayer Sep 14, 2020
Maintainer Author

Comment options

You must be logged in to vote
3 replies
@flybayer
Comment options

flybayer Sep 27, 2020
Maintainer Author

@BjoernRave
Comment options

@flybayer
Comment options

flybayer Sep 28, 2020
Maintainer Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants