graphiti_graphql 0.1.7 → 0.1.11
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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/graphiti_graphql/engine.rb +8 -8
- data/lib/graphiti_graphql/schema.rb +9 -4
- data/lib/graphiti_graphql/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3572b13acb369033180b7ab0e4bba6f610d069302dfb3efab30fb4af890ad758
|
4
|
+
data.tar.gz: 522d580599507c14ca4b477be3787905cf7574b7f9ca487418108ae0afc08cd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
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
|
-
|
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 "
|
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:
|
520
|
-
field :end_cursor, String, null:
|
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
|
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.
|
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-
|
11
|
+
date: 2021-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphiti
|