graphql_rails 0.2.1 → 0.2.2

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: 97ae2d35ab34e958eb13f188854ae609736cbdff918eafb289404b9736dffc9d
4
- data.tar.gz: 75ac9efeea9bf884a0ea424a40b04b293f41d25cb35a64c40c127101e7e681db
3
+ metadata.gz: cab765aab19541db1305cc192a5654bb804e16ddfd9d32f7bbb6ea79e6b679c4
4
+ data.tar.gz: f76c484cc5205b4e3a16cefe7d5a8a4fbac9f87eec54895316df35fc33e076a5
5
5
  SHA512:
6
- metadata.gz: 5e01ee3d1a638af00eea8f03be9b889081bccbe1b77a1d7b2123494bfb5b7c7f3cb3c6f5c68318203649333240514f3b5b2fa15a5760720b383e876a2143346e
7
- data.tar.gz: 357decd9aa77806ae4cee99bae7c8257263d5ff3ef77a42daf2aa77d17481df038fab7e8ad0a5b2d80e482b90a9be32a3bf7ab182a1cf3d41e022e0d8212e4ed
6
+ metadata.gz: ac72dfbe00f7586cff4f194c7e6efb4d78e3dc25ba10e31dae92ea482b35a70ccfdf6eb87e8f57b147c88914cbda1dc39d31bba7313074f76d0f3f587e955d9b
7
+ data.tar.gz: 2008679abf3acc2874c1564db1ebf022892e23189240a7ca9602beab323748620661c19d39bd41ca8441104c01101409ff5cd196be62ff25fcfcc1c7bf835f4a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql_rails (0.2.1)
4
+ graphql_rails (0.2.2)
5
5
  activesupport (>= 4)
6
6
  graphql (~> 1)
7
7
 
@@ -8,9 +8,10 @@ module GraphqlRails
8
8
  class Route
9
9
  attr_reader :name, :module_name, :on, :relative_path
10
10
 
11
- def initialize(name, to:, on:, **options)
11
+ def initialize(name, to: '', on:, **options)
12
12
  @name = name.to_s.camelize(:lower)
13
13
  @module_name = options[:module].to_s
14
+ @function = options[:function]
14
15
  @relative_path = to
15
16
  @on = on.to_sym
16
17
  end
@@ -28,8 +29,8 @@ module GraphqlRails
28
29
  on == :member
29
30
  end
30
31
 
31
- def options
32
- { function: Controller::ControllerFunction.build(path) }
32
+ def function
33
+ @function ||= Controller::ControllerFunction.from_route(self)
33
34
  end
34
35
  end
35
36
  end
@@ -32,7 +32,7 @@ module GraphqlRails
32
32
  name type_name
33
33
 
34
34
  routes.each do |route|
35
- field route.name, function: Controller::ControllerFunction.from_route(route)
35
+ field route.name, function: route.function
36
36
  end
37
37
  end
38
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphqlRails
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Povilas Jurčys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-24 00:00:00.000000000 Z
11
+ date: 2018-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql