Skip to content

Instantly share code, notes, and snippets.

@pmk1c
Last active July 17, 2017 09:02
Show Gist options
  • Save pmk1c/90523224e8fdc6da78ac1246a86a1deb to your computer and use it in GitHub Desktop.
Save pmk1c/90523224e8fdc6da78ac1246a86a1deb to your computer and use it in GitHub Desktop.
RestQL - create function in PostController with GraphQL
defmodule Restql.Web.PostController do
# ...
def create(conn, %{"post" => post_params}) do
graphql conn, """
mutation CreatePost($title: String!, $body: String!) {
post(title: $title, body: $body) {
id
}
}
""", post_params
end
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment