-
back on the GQL / apollo training. Having a second look at setting up the backend from scratch. referening my old learning journal which was kinda meta.
-
This guide is still the best and most comprehensive i’ve come across so far which is specific to node, ts, apollo and prisma.
-
Funneling the prisma types into codegen, means you get all of prismas auto-generated types along with the types of your graphql scheama when writing your resolvers. It’s really elegant.
-
Learning how to use
.graphql
directly in a node project. stack overflow to the rescue- Looks like the way we do it a work is with
@graphql-tools/load'
which is also what stack-overflow recommends. - this works nicely for my basic use case
import { loadSchemaSync } from "@graphql-tools/load"; import { GraphQLFileLoader } from "@graphql-tools/graphql-file-loader"; export const schema = loadSchemaSync("./src/schema/*.graphql", { loaders: [new GraphQLFileLoader()], });
- Looks like the way we do it a work is with
-
so many different flavours of apollo-server!
- When starting out, just stick with
apollo-server
. if you need to server other endpoints on the same node server, swap toapollo-server-express
there are also many other supported node backend including serverless!
- When starting out, just stick with
-
Moving on to the front end of the tutorial
-
I am only just realising now you get GQL auto completion within the vscode if you have the apollo GraphQL client extension installed