Skip to content

Commit

Permalink
Change :fragment/name type to string
Browse files Browse the repository at this point in the history
  • Loading branch information
macluck committed Jun 2, 2017
1 parent f808d09 commit a8b3249
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Now, queries are defined like this:
:active false}
:fragment/comparisonFields]
:query/alias :boss}]
:venia/fragments [{:fragment/name :comparisonFields
:venia/fragments [{:fragment/name "comparisonFields"
:fragment/type :Worker
:fragment/fields [:name :address [:friends [:name :email]]]}]}
```
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ What about fragments? Just add `:venia/fragments` vector with fragments definiti
:query/alias :workhorse}
{:query/data [:employee {:id 2 :active true} :fragment/comparisonFields]
:query/alias :boss}]
:venia/fragments [{:fragment/name :comparisonFields
:venia/fragments [{:fragment/name "comparisonFields"
:fragment/type :Worker
:fragment/fields [:name :address]}]})

Expand Down Expand Up @@ -119,7 +119,7 @@ an operation type and name. Notice, currently on `:query` operations are support
:active false}
:fragment/comparisonFields]
:query/alias :boss}]
:venia/fragments [{:fragment/name :comparisonFields
:venia/fragments [{:fragment/name "comparisonFields"
:fragment/type :Worker
:fragment/fields [:name :address [:friends [:name :email]]]}]})

Expand Down
2 changes: 1 addition & 1 deletion src/venia/spec.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
:opt [:query/alias])))
(s/def :query/alias keyword?)

(s/def :fragment/name keyword?)
(s/def :fragment/name string?)
(s/def :fragment/type keyword?)
(s/def :fragment/fields :venia/fields)
(s/def :venia/fragment (s/keys :req [:fragment/name :fragment/type :fragment/fields]))
Expand Down
10 changes: 5 additions & 5 deletions test/venia/core_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

(deftest fragment->str-test
(is (= "fragment comparisonFields on Worker{name,address,friends{name,email}}"
(v/fragment->str {:fragment/name :comparisonFields
(v/fragment->str {:fragment/name "comparisonFields"
:fragment/type :Worker
:fragment/fields [[:venia/field :name] [:venia/field :address]
[:venia/nested-field {:venia/nested-field-root :friends
Expand Down Expand Up @@ -78,7 +78,7 @@
:query/alias :workhorse}
{:query/data [:employee {:id 2 :active true} :fragment/comparisonFields]
:query/alias :boss}]
:venia/fragments [{:fragment/name :comparisonFields
:venia/fragments [{:fragment/name "comparisonFields"
:fragment/type :Worker
:fragment/fields [:name :address [:friends [:name :email]]]}]}
query-str (str "{workhorse:employee(id:1,active:true){...comparisonFields},boss:employee(id:2,active:true){...comparisonFields}} "
Expand All @@ -91,10 +91,10 @@
:query/alias :workhorse}
{:query/data [:employee {:id 2 :active true} :fragment/comparisonFields]
:query/alias :boss}]
:venia/fragments [{:fragment/name :comparisonFields
:venia/fragments [{:fragment/name "comparisonFields"
:fragment/type :Worker
:fragment/fields [:name :address [:friends [:name :email]]]}
{:fragment/name :secondFragment
{:fragment/name "secondFragment"
:fragment/type :Worker
:fragment/fields [:name]}]}
query-str (str "{workhorse:employee(id:1,active:true){...comparisonFields},boss:employee(id:2,active:true){...comparisonFields}} "
Expand Down Expand Up @@ -134,7 +134,7 @@
:active false}
:fragment/comparisonFields]
:query/alias :boss}]
:venia/fragments [{:fragment/name :comparisonFields
:venia/fragments [{:fragment/name "comparisonFields"
:fragment/type :Worker
:fragment/fields [:name :address [:friends [:name :email]]]}]}
query-str (str "query employeeQuery($id:Int,$name:String){workhorse:employee(id:$id,active:true,name:$name){...comparisonFields},"
Expand Down
4 changes: 2 additions & 2 deletions test/venia/spec_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
:variable/type :Int}
{:variable/name "name"
:variable/type :String}]
:venia/fragments [{:fragment/name :comparisonFields
:venia/fragments [{:fragment/name "comparisonFields"
:fragment/type :Worker
:fragment/fields [[:venia/field :name] [:venia/field :address]
[:venia/nested-field {:venia/nested-field-root :friends
Expand Down Expand Up @@ -110,6 +110,6 @@
:active false}
:fragment/comparisonFields]
:query/alias :boss}]
:venia/fragments [{:fragment/name :comparisonFields
:venia/fragments [{:fragment/name "comparisonFields"
:fragment/type :Worker
:fragment/fields [:name :address [:friends [:name :email]]]}]})))))

0 comments on commit a8b3249

Please sign in to comment.