From 7d798cd366ba5e7ae5dd5ddd8b5065d5be6055d2 Mon Sep 17 00:00:00 2001 From: Justin Morris Date: Tue, 1 Dec 2015 21:57:53 +1100 Subject: [PATCH] Hacked in support for new elixir-gprahql execute. Back out parse change. Remove unused execute. Revert formatting change for long function guards. document -> schema . --- mix.exs | 2 +- mix.lock | 2 +- test/graphql/plug/endpoint_test.exs | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/mix.exs b/mix.exs index 56669b5..e2be6f8 100644 --- a/mix.exs +++ b/mix.exs @@ -28,7 +28,7 @@ defmodule PlugGraphql.Mixfile do {:cowboy, "~> 1.0"}, {:plug, "~> 0.14 or ~> 1.0"}, {:poison, "~> 1.5"}, - {:graphql, "~> 0.0.4"}] + {:graphql, "0.0.6"}] end defp package do diff --git a/mix.lock b/mix.lock index 242c13f..66a0639 100644 --- a/mix.lock +++ b/mix.lock @@ -2,7 +2,7 @@ "cowlib": {:hex, :cowlib, "1.0.2"}, "earmark": {:hex, :earmark, "0.1.19"}, "ex_doc": {:hex, :ex_doc, "0.11.0"}, - "graphql": {:hex, :graphql, "0.0.4"}, + "graphql": {:hex, :graphql, "0.0.6"}, "plug": {:hex, :plug, "1.0.2"}, "poison": {:hex, :poison, "1.5.0"}, "ranch": {:hex, :ranch, "1.2.0"}} diff --git a/test/graphql/plug/endpoint_test.exs b/test/graphql/plug/endpoint_test.exs index 729dd0e..8924439 100644 --- a/test/graphql/plug/endpoint_test.exs +++ b/test/graphql/plug/endpoint_test.exs @@ -8,19 +8,18 @@ defmodule GraphQL.Plug.EndpointTest do %GraphQL.Schema{ query: %GraphQL.ObjectType{ name: "RootQueryType", - fields: [ - %GraphQL.FieldDefinition{ - name: "greeting", + fields: %{ + greeting: %GraphQL.FieldDefinition{ type: "String", - resolve: &TestSchema.greeting/1, + resolve: &TestSchema.greeting/3, } - ] + } } } end - def greeting(name: name), do: "Hello, #{name}!" - def greeting(_), do: greeting(name: "world") + def greeting(_, %{name: name}, _), do: "Hello, #{name}!" + def greeting(_, _, _), do: greeting(%{}, %{name: "world"}, %{}) end # Setup a Plug which calls the Plug under test