rails-graphql-generator 0.0.2 → 0.1.0
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/lib/generators/graphql/graphql_helpers.rb +3 -3
- data/lib/generators/graphql/init_generator.rb +1 -3
- data/lib/generators/graphql/templates/graph/node_identification.rb +1 -1
- data/lib/generators/graphql/templates/graph/relay_schema.rb +3 -1
- data/lib/generators/graphql/templates/graph/types/root_level_type.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3acf66b9de9ac2d7d47c12cf254c1cec862dde78
|
|
4
|
+
data.tar.gz: 69c4f1cf237bebddd65a055ad55ff3e3d7e05e17
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d12a8af79e1833dac2bde22edf65a4bf8f90f83bb850be383e296a78d442d3ca96cf2b6dafc793aad3cf5a5c67aaf15b77445e2c62e446ef4a834e932e320c09
|
|
7
|
+
data.tar.gz: 723f0e4dece6f830882971cd589e7df4b49c72e5ca7a4083dbc20f94138961f68f8b40f53bae5ff518bcfddbc2af82fb55603e8079a6ad899eaf0c82e72c9020
|
|
@@ -27,8 +27,8 @@ module Graphql
|
|
|
27
27
|
description '#{model.to_s} type'
|
|
28
28
|
|
|
29
29
|
interfaces [NodeIdentification.interface]
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
|
|
31
|
+
global_id_field :id
|
|
32
32
|
# End of fields
|
|
33
33
|
end
|
|
34
34
|
FILE
|
|
@@ -41,7 +41,7 @@ end
|
|
|
41
41
|
next if columns[k].name == 'id'
|
|
42
42
|
|
|
43
43
|
if columns[k].type.present?
|
|
44
|
-
inject_into_file type_path(model), after: "
|
|
44
|
+
inject_into_file type_path(model), after: "global_id_field :id\n" do <<-FILE
|
|
45
45
|
field :#{columns[k].name}, types.#{type_mapper[columns[k].type]}
|
|
46
46
|
FILE
|
|
47
47
|
end
|
|
@@ -4,8 +4,7 @@ module Graphql
|
|
|
4
4
|
source_root File.expand_path('../templates', __FILE__)
|
|
5
5
|
|
|
6
6
|
def add_gems
|
|
7
|
-
gem 'graphql'
|
|
8
|
-
gem 'graphql-relay'
|
|
7
|
+
gem 'graphql'
|
|
9
8
|
gem 'graphiql-rails'
|
|
10
9
|
gem 'graphql-formatter'
|
|
11
10
|
end
|
|
@@ -36,4 +35,3 @@ module Graphql
|
|
|
36
35
|
end
|
|
37
36
|
end
|
|
38
37
|
end
|
|
39
|
-
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
RelaySchema = GraphQL::Schema.new(query: QueryType, mutation: MutationType)
|
|
2
2
|
|
|
3
|
+
RelaySchema.node_identification = NodeIdentification
|
|
4
|
+
|
|
3
5
|
module RelaySchemaHelpers
|
|
4
6
|
SCHEMA_DIR = Rails.root.join('app/assets/javascripts/relay/')
|
|
5
7
|
SCHEMA_PATH = File.join(SCHEMA_DIR, 'schema.json')
|
|
@@ -30,4 +32,4 @@ module RelaySchemaHelpers
|
|
|
30
32
|
|
|
31
33
|
end
|
|
32
34
|
|
|
33
|
-
RelaySchema.extend RelaySchemaHelpers
|
|
35
|
+
RelaySchema.extend RelaySchemaHelpers
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails-graphql-generator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Muhammet
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-08-
|
|
11
|
+
date: 2016-08-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|