From Zero to a Running GraphQL API in Two Steps

GraphQL: Out-of-the-box

No tables. No DB management. Only GraphQL.

Step 1. Run Dgraph with Docker

docker run -p 8080:8080 -it -v /mnt/dgraph:/dgraph dgraph/standalone:v2.0.0-beta

Step 2. Give your GraphQL schema to Dgraph

Click here
type Film {
  id: ID!
  name: String! @search(by: [hash])
  initial_release_date: DateTime
  featured_locations: [Location]
  Directed_by: [Director] @hasInverse(field: films)
}
type Location {
  id: ID!
  name: String @search(by: [hash])
  featured_in_films: [Film] @hasInverse(field: featured_locations)
}
type Director {
  id: ID!
  name: String @search(by: [term, fulltext])
  films: [Film]
}

That’s it! Now you have GraphQL up and running. Give it a try yourself with our interactive demo below.

Let me know if you have any questions or feedback.

@awefulBrown

1 Like