graphiti_graphql 0.1.7 → 0.1.11

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: cc432e46c0ddb7fb38495da303d3eb9c5100ca56a75d53c92646d8f2119c4eba
4
- data.tar.gz: 9eb0bcd701933b21f3fffa985ef8a1018ef24419669aeff5fbfc8a83b6419456
3
+ metadata.gz: 3572b13acb369033180b7ab0e4bba6f610d069302dfb3efab30fb4af890ad758
4
+ data.tar.gz: 522d580599507c14ca4b477be3787905cf7574b7f9ca487418108ae0afc08cd5
5
5
  SHA512:
6
- metadata.gz: 4ed58eb809cb6c3baf5022f170f99919a60a885c0677cbc1de6f3d12e4484b8575fcbf2d7cb5d8adb8c22e305c82e586c1fd7070da3bdbb07ed0da7192b4c59d
7
- data.tar.gz: ed579a04fcdfc44ca5ae5b461530ceb212c536fb6dd2e515426bde26097daaaf6e93235c3b36789bebeae35defa54a4f77e721333e7d4b2932c2a51a45dd4eac
6
+ metadata.gz: 697d98b5580457160179f895ded0fd81738c7714773636a9850ecab3b131ca6bab9a4e916c131f7a29519631a7333640135870f2d95d4c14aa2916c67c00b68d
7
+ data.tar.gz: 2cc559be1dc33bf52056d1be94e6a3a0cb88a4de240bcd19603dd1661e2f27c6504d1cc315c8ab5b888828868857fb05c9bb535353793ed810cbbd84924e2968
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphiti_graphql (0.1.6)
4
+ graphiti_graphql (0.1.10)
5
5
  activesupport (>= 4.1)
6
6
  graphiti (~> 1.3)
7
7
  graphql (~> 1.12)
@@ -80,7 +80,7 @@ GEM
80
80
  rainbow (3.0.0)
81
81
  rake (10.5.0)
82
82
  regexp_parser (2.0.3)
83
- rexml (3.2.4)
83
+ rexml (3.2.5)
84
84
  rspec (3.10.0)
85
85
  rspec-core (~> 3.10.0)
86
86
  rspec-expectations (~> 3.10.0)
@@ -64,15 +64,15 @@ module GraphitiGraphQL
64
64
  end
65
65
 
66
66
  initializer "graphiti_graphql.define_controller" do
67
- app_controller = GraphitiGraphQL.config.federation_application_controller || ::ApplicationController
68
- # rubocop:disable Lint/ConstantDefinitionInBlock(Standard)
69
- class GraphitiGraphQL::ExecutionController < app_controller
70
- register_exception Graphiti::Errors::UnreadableAttribute, message: true
71
- def execute
72
- params = request.params # avoid strong_parameters
73
- render json: Graphiti.gql(params[:query], params[:variables])
67
+ app_controller = GraphitiGraphQL.config.federation_application_controller || ::ApplicationController
68
+ # rubocop:disable Lint/ConstantDefinitionInBlock(Standard)
69
+ class GraphitiGraphQL::ExecutionController < app_controller
70
+ register_exception Graphiti::Errors::UnreadableAttribute, message: true
71
+ def execute
72
+ params = request.params # avoid strong_parameters
73
+ render json: Graphiti.gql(params[:query], params[:variables])
74
+ end
74
75
  end
75
- end
76
76
  end
77
77
 
78
78
  initializer "graphiti_graphql.federation" do
@@ -95,10 +95,15 @@ module GraphitiGraphQL
95
95
  query_class.graphql_name "Query"
96
96
  query_class.field_class BaseField
97
97
 
98
- get_entrypoints(entrypoint_resources).each do |resource|
98
+ # Ensure all types are generated, even if they aren't in a top-level Query
99
+ # We might now want to expose the query, but do want to federate the Type
100
+ graphiti_schema.resources.each do |resource|
99
101
  next if resource.remote?
100
102
  generate_type(resource)
103
+ end
101
104
 
105
+ get_entrypoints(entrypoint_resources).each do |resource|
106
+ next if resource.remote?
102
107
  add_index(query_class, resource)
103
108
  add_show(query_class, resource)
104
109
  end
@@ -505,7 +510,7 @@ module GraphitiGraphQL
505
510
  end
506
511
 
507
512
  class PageType < GraphQL::Schema::InputObject
508
- graphql_name "Page"
513
+ graphql_name "PageInput"
509
514
  argument :size, Int, required: false
510
515
  argument :number, Int, required: false
511
516
  argument :after, String, required: false
@@ -516,8 +521,8 @@ module GraphitiGraphQL
516
521
  graphql_name "PageInfo"
517
522
  field :has_next_page, Boolean, null: false
518
523
  field :has_previous_page, Boolean, null: false
519
- field :start_cursor, String, null: false
520
- field :end_cursor, String, null: false
524
+ field :start_cursor, String, null: true
525
+ field :end_cursor, String, null: true
521
526
  end
522
527
 
523
528
  class SortDirType < GraphQL::Schema::Enum
@@ -1,3 +1,3 @@
1
1
  module GraphitiGraphQL
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphiti_graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-08 00:00:00.000000000 Z
11
+ date: 2021-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphiti