decidim-api 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ffdaf574e6187c65b307fff6a4af95357b05ab8
4
- data.tar.gz: 38015f8c99811f27c8b23f54947adf99a4882bd9
3
+ metadata.gz: f67998f0e9c0fb9de5b0c33076890575762820e7
4
+ data.tar.gz: e6335fa0c187aeb089f3a0018c2600f9f02f7f90
5
5
  SHA512:
6
- metadata.gz: 9735699184e7c9342f3bd35d2cf3de757bdb56e16ae64474999253af4ba0edb1d670d809a1d6657c486680593e507dfa5297f72b570006085b9fbb504e4863d4
7
- data.tar.gz: ba36b1c10378361484fed78c55ac44f031539810f5f6dce7cb1c9715ba9ea92613f21d141ae60b78842ed9d3207b3c2f5f5498f126a34df5e01782578da2f8cf
6
+ metadata.gz: 893af6224269ec96ad53358ca9fec01a0168d56a1e3f1b1588a395d4052c11f59df18b8264b85ef45935ad88651ff0ba2c174a92202425072c9b1296f653a81d
7
+ data.tar.gz: c40211fc20fce57cb9966783594f44da357bcfbf7a3f2d4faff8d3b51de41099ea0995f6b0681073df984722341de847fd22e81e2053f708f5129710e7d1a207
@@ -1,7 +1,7 @@
1
1
  <html>
2
2
  <head>
3
3
  <title><%= current_organization.name %> - API Documentation</title>
4
- <%= javascript_include_tag 'decidim/api/docs', 'data-turbolinks-track': 'reload' %>
4
+ <%= javascript_include_tag 'decidim/api/docs' %>
5
5
  </head>
6
6
  <body>
7
7
  <%= yield %>
@@ -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
@@ -18,6 +18,7 @@ RSpec.shared_context "graphql type" do
18
18
 
19
19
  GraphQL::Schema.define do
20
20
  query query_type
21
+ resolve_type ->(obj, ctx) {}
21
22
  end
22
23
  end
23
24
 
@@ -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.2
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-23 00:00:00.000000000 Z
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.1
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.1
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.2
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.2
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