graphoid 0.0.7 → 0.0.8

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
  SHA256:
3
- metadata.gz: c3aa5dca7382c24ce0c94bac0aa9dcd3bc7399c753f8b902d33ea55f06276307
4
- data.tar.gz: 2d435169037eb9b817bac6d4934a7d340367452bafb9f0aa71b07dd26460659e
3
+ metadata.gz: 0e2f377db61ee5c9407c4b88815d73c50a40a2049fed6558f55c1691818b922c
4
+ data.tar.gz: 2b06c721c9421f7bcbebe789b0c6468b24a29eb6381f5c49bfbe095d4552058d
5
5
  SHA512:
6
- metadata.gz: 84698893bcc929decb4e8d0670d2f61af2236c841bf63cf86e0b3e3b80917fe324da48572ed3329e515ee90c3632133a4e822dc7d5fc8fba50f0d309a91c2b41
7
- data.tar.gz: 6a60a45be321286579774f63b4bc35a9e0dda271b0540d12830f790ebccd4fea4ca3028f57b177c01d71770e289bfe01c422d4d910a0fa4d81ec4402eedf198c
6
+ metadata.gz: 5eaf51f3fb5ee287831426af53fa32aac270c8f3246ea32a5475ddfe4eb10b9c95ef9a170893ffcb5e2006cce42e02fcf8f765fbf66f43789f65e1b75d5c4d74
7
+ data.tar.gz: 1486891029aeee089d9294194b547866ecf42e6c93e678ac111f2d8ac129c92dcaaeb18d2a83f08ac192482d7d3992a25d32be49d3c4edd0f7cab4458e0d4edd
@@ -24,21 +24,25 @@ module Graphoid
24
24
 
25
25
  type.class_eval do
26
26
  define_method :"#{name}" do |data: {}|
27
- user = context[:current_user]
28
- Graphoid::Mutations::Processor.execute(model, grapho, data, user)
29
- rescue Exception => ex
30
- GraphQL::ExecutionError.new(ex.message)
27
+ begin
28
+ user = context[:current_user]
29
+ Graphoid::Mutations::Processor.execute(model, grapho, data, user)
30
+ rescue Exception => ex
31
+ GraphQL::ExecutionError.new(ex.message)
32
+ end
31
33
  end
32
34
  end
33
35
 
34
36
  type.class_eval do
35
37
  define_method :"#{plural_name}" do |data: []|
36
- user = context[:current_user]
37
- result = []
38
- data.each { |d| result << Graphoid::Mutations::Processor.execute(model, grapho, d, user) }
39
- result
40
- rescue Exception => ex
41
- GraphQL::ExecutionError.new(ex.message)
38
+ begin
39
+ user = context[:current_user]
40
+ result = []
41
+ data.each { |d| result << Graphoid::Mutations::Processor.execute(model, grapho, d, user) }
42
+ result
43
+ rescue Exception => ex
44
+ GraphQL::ExecutionError.new(ex.message)
45
+ end
42
46
  end
43
47
  end
44
48
  end
@@ -24,21 +24,25 @@ module Graphoid
24
24
 
25
25
  type.class_eval do
26
26
  define_method :"#{name}" do |id:|
27
- result = model.find(id)
28
- result.destroy!
29
- result
30
- rescue Exception => ex
31
- GraphQL::ExecutionError.new(ex.message)
27
+ begin
28
+ result = model.find(id)
29
+ result.destroy!
30
+ result
31
+ rescue Exception => ex
32
+ GraphQL::ExecutionError.new(ex.message)
33
+ end
32
34
  end
33
35
  end
34
36
 
35
37
  type.class_eval do
36
38
  define_method :"#{plural}" do |where: {}|
37
- objects = Graphoid::Queries::Processor.execute(model, where.to_h)
38
- objects.destroy_all
39
- objects.all.to_a
40
- rescue Exception => ex
41
- GraphQL::ExecutionError.new(ex.message)
39
+ begin
40
+ objects = Graphoid::Queries::Processor.execute(model, where.to_h)
41
+ objects.destroy_all
42
+ objects.all.to_a
43
+ rescue Exception => ex
44
+ GraphQL::ExecutionError.new(ex.message)
45
+ end
42
46
  end
43
47
  end
44
48
  end
@@ -25,23 +25,26 @@ module Graphoid
25
25
 
26
26
  query_type.class_eval do
27
27
  define_method :"#{grapho.name}" do |id: nil, where: nil|
28
- return model.find(id) if id
29
-
30
- Processor.execute(model, where.to_h).first
31
- rescue Exception => ex
32
- GraphQL::ExecutionError.new(ex.message)
28
+ begin
29
+ return model.find(id) if id
30
+ Processor.execute(model, where.to_h).first
31
+ rescue Exception => ex
32
+ GraphQL::ExecutionError.new(ex.message)
33
+ end
33
34
  end
34
35
  end
35
36
 
36
37
  query_type.class_eval do
37
38
  define_method :"#{grapho.plural}" do |where: nil, order: nil, limit: nil, skip: nil|
38
- model = Graphoid.driver.eager_load(context.irep_node, model)
39
- result = Processor.execute(model, where.to_h)
40
- order = Processor.parse_order(model, order.to_h)
41
- result = result.order(order).limit(limit)
42
- Graphoid.driver.skip(result, skip)
43
- rescue Exception => ex
44
- GraphQL::ExecutionError.new(ex.message)
39
+ begin
40
+ model = Graphoid.driver.eager_load(context.irep_node, model)
41
+ result = Processor.execute(model, where.to_h)
42
+ order = Processor.parse_order(model, order.to_h)
43
+ result = result.order(order).limit(limit)
44
+ Graphoid.driver.skip(result, skip)
45
+ rescue Exception => ex
46
+ GraphQL::ExecutionError.new(ex.message)
47
+ end
45
48
  end
46
49
 
47
50
  alias_method :"_#{grapho.plural}_meta", :"#{grapho.plural}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maximiliano Perez Coto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-26 00:00:00.000000000 Z
11
+ date: 2019-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.8.17
19
+ version: '1.8'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.8.17
26
+ version: '1.8'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -99,7 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  requirements: []
102
- rubygems_version: 3.0.3
102
+ rubyforge_project:
103
+ rubygems_version: 2.7.9
103
104
  signing_key:
104
105
  specification_version: 4
105
106
  summary: Generates a GraphQL API from Rails ActiveRecord or Mongoid