decidim-api 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f67998f0e9c0fb9de5b0c33076890575762820e7
|
4
|
+
data.tar.gz: e6335fa0c187aeb089f3a0018c2600f9f02f7f90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 893af6224269ec96ad53358ca9fec01a0168d56a1e3f1b1588a395d4052c11f59df18b8264b85ef45935ad88651ff0ba2c174a92202425072c9b1296f653a81d
|
7
|
+
data.tar.gz: c40211fc20fce57cb9966783594f44da357bcfbf7a3f2d4faff8d3b51de41099ea0995f6b0681073df984722341de847fd22e81e2053f708f5129710e7d1a207
|
data/lib/decidim/api/schema.rb
CHANGED
@@ -5,6 +5,11 @@ module Decidim
|
|
5
5
|
Schema = GraphQL::Schema.define do
|
6
6
|
query QueryType
|
7
7
|
mutation MutationType
|
8
|
+
|
9
|
+
resolve_type lambda { |obj, _ctx|
|
10
|
+
return Decidim::UserType if obj.is_a? Decidim::User
|
11
|
+
return Decidim::UserGroupType if obj.is_a? Decidim::UserGroup
|
12
|
+
}
|
8
13
|
end
|
9
14
|
end
|
10
15
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Decidim
|
3
|
+
module Api
|
4
|
+
# This interface represents an author who owns a resource.
|
5
|
+
AuthorInterface = GraphQL::InterfaceType.define do
|
6
|
+
name "Author"
|
7
|
+
description "An author"
|
8
|
+
|
9
|
+
field :name, !types.String, "The author's name"
|
10
|
+
field :avatarUrl, !types.String, "The author's avatar url"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/decidim/api.rb
CHANGED
@@ -7,6 +7,7 @@ module Decidim
|
|
7
7
|
module Api
|
8
8
|
autoload :MutationType, "decidim/api/types/mutation"
|
9
9
|
autoload :QueryType, "decidim/api/types/query"
|
10
|
+
autoload :AuthorInterface, "decidim/api/types/author_interface"
|
10
11
|
|
11
12
|
autoload :TranslatedFieldType, "decidim/api/types/translated_field"
|
12
13
|
autoload :LocalizedStringType, "decidim/api/types/localized_string"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-01
|
13
|
+
date: 2017-02-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -38,14 +38,14 @@ dependencies:
|
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 1.4.
|
41
|
+
version: 1.4.2
|
42
42
|
type: :runtime
|
43
43
|
prerelease: false
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 1.4.
|
48
|
+
version: 1.4.2
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: graphiql-rails
|
51
51
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,14 +94,14 @@ dependencies:
|
|
94
94
|
requirements:
|
95
95
|
- - '='
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 0.0.
|
97
|
+
version: 0.0.3
|
98
98
|
type: :development
|
99
99
|
prerelease: false
|
100
100
|
version_requirements: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - '='
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 0.0.
|
104
|
+
version: 0.0.3
|
105
105
|
description: API engine for decidim
|
106
106
|
email:
|
107
107
|
- josepjaume@gmail.com
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- lib/decidim/api/graphiql-initial-query.txt
|
127
127
|
- lib/decidim/api/schema.rb
|
128
128
|
- lib/decidim/api/test/type_context.rb
|
129
|
+
- lib/decidim/api/types/author_interface.rb
|
129
130
|
- lib/decidim/api/types/localized_string.rb
|
130
131
|
- lib/decidim/api/types/mutation.rb
|
131
132
|
- lib/decidim/api/types/query.rb
|