Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit e6f4faf

Browse files
author
Josh Price
committed
Remove directive implementation options
1 parent 5a1b54e commit e6f4faf

File tree

2 files changed

+6
-47
lines changed

2 files changed

+6
-47
lines changed

lib/graphql/type/directive.ex

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,12 @@
11
defmodule GraphQL.Type.Directive do
22
@moduledoc """
3-
# Options for implementing directives
4-
5-
## Option 1
6-
7-
defmodule GraphQL.Type.Directives do
8-
def directives do
9-
%{
10-
skip: %Directive{}
11-
include: %Directive{}
12-
deprecated: %Directive{}
13-
}
14-
end
15-
end
16-
17-
## Option 2
18-
19-
defmodule GraphQL.Type.Directives do
20-
def skip do
21-
%Directive{}
22-
end
23-
end
24-
25-
## Option 3
26-
27-
defmodule GraphQL.Type.Directives.Skip do
28-
def directive do
29-
%Directive{
30-
}
31-
end
32-
end
33-
34-
## Option 4
35-
36-
@directive Deprecated, %Directive{ ... }
37-
@directive Include, %Directive{ ... }
38-
@directive Skip, %Directive{ ... }
39-
40-
Going with option 2 for now,
41-
but this doesn't easily support external custom extension.
3+
Directives currently supported are @skip and @include
424
"""
435
defstruct name: "Directive", description: nil, locations: [], args: %{}
446
end
457

468
defmodule GraphQL.Type.Directives do
47-
alias GraphQL.Type.Directive
48-
alias GraphQL.Type.Boolean
49-
alias GraphQL.Type.NonNull
50-
alias GraphQL.Type.String
9+
alias GraphQL.Type.{Directive, Boolean, NonNull, String}
5110

5211
def include do
5312
%Directive{

mix.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
%{"bunt": {:hex, :bunt, "0.1.5", "c378ea1698232597d3778e4b83234dcea4a60e7c28114b0fe53657a2c0d8885e", [:mix], []},
2-
"credo": {:hex, :credo, "0.3.7", "1db06555e6bd3f6e45b418529f625f2311e561ea8e86b1293601092602dc40be", [:mix], [{:bunt, "~> 0.1.4", [hex: :bunt, optional: false]}]},
1+
%{"bunt": {:hex, :bunt, "0.1.6", "5d95a6882f73f3b9969fdfd1953798046664e6f77ec4e486e6fafc7caad97c6f", [:mix], []},
2+
"credo": {:hex, :credo, "0.3.13", "90d2d2deb9d376bb2a63f81126a320c3920ce65acb1294982ab49a8aacc7d89f", [:mix], [{:bunt, "~> 0.1.4", [hex: :bunt, optional: false]}]},
33
"dialyxir": {:hex, :dialyxir, "0.3.3", "2f8bb8ab4e17acf4086cae847bd385c0f89296d3e3448dc304c26bfbe4b46cb4", [:mix], []},
44
"dogma": {:hex, :dogma, "0.1.5", "d8d9c9d50f099c5bde47334da077b555b2027147d16906ea7bb4e7cdaedb2d8b", [:mix], [{:poison, ">= 1.0.0", [hex: :poison, optional: false]}]},
55
"earmark": {:hex, :earmark, "0.2.1", "ba6d26ceb16106d069b289df66751734802777a3cbb6787026dd800ffeb850f3", [:mix], []},
6-
"ex_doc": {:hex, :ex_doc, "0.11.4", "a064bdb720594c3745b94709b17ffb834fd858b4e0c1f48f37c0d92700759e02", [:mix], [{:earmark, "~> 0.1.17 or ~> 0.2", [hex: :earmark, optional: true]}]},
6+
"ex_doc": {:hex, :ex_doc, "0.11.5", "0dc51cb84f8312162a2313d6c71573a9afa332333d8a332bb12540861b9834db", [:mix], [{:earmark, "~> 0.1.17 or ~> 0.2", [hex: :earmark, optional: true]}]},
77
"fs": {:hex, :fs, "0.9.2", "ed17036c26c3f70ac49781ed9220a50c36775c6ca2cf8182d123b6566e49ec59", [:rebar], []},
88
"inch_ex": {:hex, :inch_ex, "0.5.1", "c1c18966c935944cbb2d273796b36e44fab3c54fd59f906ff026a686205b4e14", [:mix], [{:poison, "~> 1.5 or ~> 2.0", [hex: :poison, optional: false]}]},
9-
"mix_test_watch": {:hex, :mix_test_watch, "0.2.4", "a4a35d1c11ebcb12f2339b226ec0746333a3f7a926775977506ca5ad02ef5bce", [:mix], [{:fs, "~> 0.9.1", [hex: :fs, optional: false]}]},
9+
"mix_test_watch": {:hex, :mix_test_watch, "0.2.6", "9fcc2b1b89d1594c4a8300959c19d50da2f0ff13642c8f681692a6e507f92cab", [:mix], [{:fs, "~> 0.9.1", [hex: :fs, optional: false]}]},
1010
"poison": {:hex, :poison, "2.1.0", "f583218ced822675e484648fa26c933d621373f01c6c76bd00005d7bd4b82e27", [:mix], []}}

0 commit comments

Comments
 (0)