Starting Simple

Using a GraphQL API from the client side doesn’t necessitate a big framework or a lot of tooling. A plain old JavaScript script will do. We’re going to start by building the simplest of JavaScript projects just to illustrate how to configure a basic client.

We’ll set this up as a separate project from the PlateSlate Phoenix-based application. As noted in ​System Dependencies​, you’re going to need Node.js,[32] so if you don’t already have a working installation, now’s the time to get it set up and running. We recommend installation by using your favorite package manager, or a Node.js version manager if you see yourself using different versions in the future.

Once you have Node.js installed, you should be able ...

Get Craft GraphQL APIs in Elixir with Absinthe now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.