Skip to content

Instantly share code, notes, and snippets.

@e0ipso
Last active October 12, 2018 12:59
Show Gist options
  • Save e0ipso/4c55187270b5b75cca7229762cca235d to your computer and use it in GitHub Desktop.
Save e0ipso/4c55187270b5b75cca7229762cca235d to your computer and use it in GitHub Desktop.
Example schema with auto-resolvers from OpenAPI definitions
type Recipe {
id: String!
title: String!
author: User!
}
type User {
id: String!
name: String!
recipes: [Recipe]
}
type Query {
recipesByAuthor(authorName: String!): [Recipe] @fromJsonApi('/recipes?filter[author.name]={authorName}&include=author')
articlesByAuthor(authorName: String!): [Article] @fromJsonApi('/articles?filter[owner.name]={authorName}&include=owner')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment