In the newest version of Nodal, we're pleased to announce the first steps in our GraphQL implementation. We're a bit limited in scope and don't yet support the full specification (only parts of queries), but we're really excited to offer a fully-integrated developer-friendly GraphQL solution, built atop PostgreSQL. We think GraphQL represents a great step forward for service-oriented architectures, providing front-end developers more effective control over the data they retrieve.

For the GitHub repo running this example, check out keithwhor/nodal-graphql.

Client GraphQL (Edit Me!) users { id, username, email, age, threads { title, created_at, posts { user { username }, body, created_at } } } Send Request Nodal Server Response

If you're curious about what this is built with: we've built our own GraphQL syntax parser, have it translate the syntax tree into a format Nodal's Composer (ORM) is familiar with, and then generate queries from there. Our data layer is entirely PostgreSQL, and each call to the database exists as a single query with multiple joins.

We welcome you to play with our GraphQL endpoint. We have a sample of 3 users, 9 threads and 27 posts for you to query.

There are three models: User (users): id, email, age, created_at, updated_at, threads, posts

Thread (threads): id, title, created_at, updated_at, user, posts

Post (posts): id, body, created_at, updated_at, user, thread And a number of operators: is, not, lt, lte, gt, gte, contains, icontains, startswith, endswith, iendswith, like, ilike

Query all Users Client GraphQL (Edit Me!) users Send Request Nodal Server Response

Query Users with username Client GraphQL (Edit Me!) user(username: "Sansa Stark") { id, username, email } Send Request Nodal Server Response

Query all Users and their Threads Client GraphQL (Edit Me!) users { id, username, email, threads } Send Request Nodal Server Response

Query all Users their Threads, and Posts in Threads Client GraphQL (Edit Me!) users { id, username, email, threads { id, title, posts { body } } } Send Request Nodal Server Response

Query all Threads, Users, Posts, and Users of Posts Client GraphQL (Edit Me!) threads { id, title, user { id, username }, posts(body__contains: "hello") { body, user { username }, created_at } } Send Request Nodal Server Response

Do Something Crazy Client GraphQL (Edit Me!) posts { id, body, user(age__lt: 25) { username, threads { posts(user__username__startswith: "J") { body, user } } } } Send Request Nodal Server Response

The code that generates these responses is simple. Play with the repo yourself at github.com/keithwhor/nodal-graphql