Calling Your New API
Now that you've got a basic HTTP API setup, you can start making API requests to it.
API Documentation
You should now be able to access the API docs at http://localhost:8080/docs, which should display a nice UI (scalar) for exploring the API, and executing sample requests:
Sample Requests with Curl
Here are a few sample requests that you can execute with curl.
Create a new user (note the id
field in the response, we'll use that in further requests)
Create a new pet who is owned by the user we just created
Notice that the response includes the edges
field. This is because we've added the owner
edge to
be eager-loaded in the schema, as shown below:
Now query the pets that the user owns
This uses the auto-generated edge endpoint on the User
schema.