This project builds a GraphQL API using the free JSONPlaceholder REST API, a free fake API for testing and prototyping.
You'll need to create a StepZen account first. Once you've got that set up, git clone this repository onto your machine and open the working directory:
git clone https://github.com/stepzen-dev/examples.git
cd examples/with-jsonplaceholder
JSONPlaceholder comes with a set of 6 common resources:
You can use path parameters (https://jsonplaceholder.typicode.com/posts/[ID]
), query parameters (https://jsonplaceholder.typicode.com/posts/?userId=[ID]
) and much more... see the JSONPlaceholder docs for the full list.
Open your terminal and install the StepZen CLI. You need to login here using the command: stepzen login
.
Start the GraphQL by running stepzen start
. After you've followed the prompts (you can accept the suggested endpoint name or add your own), a proxy of the GraphiQL playground becomes available at http://localhost/5001
(in example http://localhost:5001/api/with-jsonplaceholder
), which you can use to explore the GraphQL API. Also, the endpoint at which your GraphQL API is deployed gets logged in the terminal. You can query your GraphQL API from any application, browser, or IDE by providing the API Key linked to your account.
You can learn more in the StepZen documentation. Questions? Head over to Discord or GitHub Discussions to ask questions.