5. Apollo Sandbox Explorer
5m

Overview

We have enough to test our . We could send it a request using the curl command — accept HTTP requests after all! But let's make our lives a little easier by using a GraphQL IDE instead.

In this lesson, we will:

  • Discover the benefits of using
  • Examine a 's schema
  • Build our first

Apollo Sandbox

Enter Apollo Sandbox. Sandbox is free to use and doesn't require an account. It's part of the platform, and helps with local graph development.

Apollo GraphOS is a complete cloud platform for building, managing, and scaling your . provides a set of tools and services so that product developers can focus on building better apps, faster.

With Sandbox, we can load a 's schema and explore it using some cool features such as a schema reference and the Explorer.

The Explorer is a powerful web IDE for creating, running, and managing . It lets us build operations easily and quickly, look at our operation history, peek at response hints, and share operations with others.

We've already told Strawberry to use as an IDE, using the graphql_ide parameter.

main.py
graphql_router = GraphQLRouter(schema, path="/", graphql_ide="apollo-sandbox")

Let's try it out! First, if your server isn't running, make sure to start it up again with uvicorn main:app --reload.

Then, let's jump over to http://localhost:8000 in the browser.

Exploring our schema

Let's check out our schema, which is the first tab in our main navigation.

http://localhost:8000

Schema page

Here we have a full view and reference into our schema! It's pretty sparse right now, but we can see our Query type with a hello that returns a String type.

In the tab, we can also see the schema in SDL syntax.

http://localhost:8000

SDL page

Exploring the Explorer

Let's jump back over to the Explorer page.

The Operation panel in the middle is where we create queries. The Explorer may have already filled in a default . Let's open up a new workspace tab with the + button for a fresh start.

http://localhost:8000

Sandbox hovering over new workspace

We can write the manually or add from the Documentation panel on the left.

The Explorer's Documentation tab enables us to drill down into our schema's , starting at the entry points of the Query type.

Clicking on the plus (⊕) button next to a automatically adds that field to our current . This is a handy way to assemble complex queries without needing to remember your schema's exact structure or syntax.

http://localhost:8000

Running an operation in Sandbox

Go ahead and add the hello .

query Query {
hello
}

At the top of the Operation panel is the button to run our . Let's click it now and see what happens:

http://localhost:8000

Running an operation in Sandbox

The Response panel on the right shows us our first "Hello world"! 👋

{
"data": {
"hello": "Hello world"
}
}

We just ran our first GraphQL query! 🎉

Practice

Which of these are benefits of using the Apollo Sandbox Explorer?

Key takeaways

  • is a powerful web IDE designed for local development. It simplifies the process of creating, running, and managing .
  • Explorer allows us to explore our and build and run GraphQL easily.
  • Strawberry allows developers to code in a familiar Python environment and conventions. It translates those Python types and conventions into and conventions behind the scenes.

Up next

Let's up the tempo in this schema and showcase some playlists!

Previous

Share your questions and comments about this lesson

This course is currently in

beta
. Your feedback helps us improve! If you're stuck or confused, let us know and we'll help you out. All comments are public and must follow the Apollo Code of Conduct. Note that comments that have been resolved or addressed may be removed.

You'll need a GitHub account to post below. Don't have one? Post in our Odyssey forum instead.