This is a major architectural change that's difficult to summarize. I decided to do the entire migration in a single PR since GraphQL itself is so deeply integrated with the rest of Bison. A good portion of the changes are documentation, though, so hopefully reviewing everything else isn't too bad.
First, this PR removes code, config, and dependencies related to GraphQL. That includes Nexus, GraphQL Codegen, Apollo Server, and Apollo Client. This also includes anything that references the files generated by Nexus and GQL Codegen.
Next, I created a tRPC router and middleware for authenticated procedures. I created the userRouter and replicated all of the queries and mutations that existed in the GraphQL schema. After wiring it up to an API route, I set up the tRPC client and replaced all the GraphQL queries with tRPC calls, making adjustments as necessary to make everything behave nicely.
I also rewrote the test files using a new trpcRequest helper, which lets you optionally pass a user record to make the request.
Once I confirmed the app was generating correctly, I updated the hygiene templates to use tRPC, updated the ReadMe and other documentation.
Changes
This is a major architectural change that's difficult to summarize. I decided to do the entire migration in a single PR since GraphQL itself is so deeply integrated with the rest of Bison. A good portion of the changes are documentation, though, so hopefully reviewing everything else isn't too bad.
First, this PR removes code, config, and dependencies related to GraphQL. That includes Nexus, GraphQL Codegen, Apollo Server, and Apollo Client. This also includes anything that references the files generated by Nexus and GQL Codegen.
Next, I created a tRPC router and middleware for authenticated procedures. I created the
userRouter
and replicated all of the queries and mutations that existed in the GraphQL schema. After wiring it up to an API route, I set up the tRPC client and replaced all the GraphQL queries with tRPC calls, making adjustments as necessary to make everything behave nicely.I also rewrote the test files using a new
trpcRequest
helper, which lets you optionally pass a user record to make the request.Once I confirmed the app was generating correctly, I updated the hygiene templates to use tRPC, updated the ReadMe and other documentation.
Checklist