rails-graphql-generator 0.0.2 → 0.1.0

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
  SHA1:
3
- metadata.gz: abf0f104118448b4b242bffe563fe30c282a9e42
4
- data.tar.gz: 2519d5a582124bdd8067a8c7c80f692ca7878852
3
+ metadata.gz: 3acf66b9de9ac2d7d47c12cf254c1cec862dde78
4
+ data.tar.gz: 69c4f1cf237bebddd65a055ad55ff3e3d7e05e17
5
5
  SHA512:
6
- metadata.gz: 7edbd271e42b8bf3ff0bea85efaf7faccfc4d7101c3d7cbd74cefae6ff4fa5e0a50d692973f41203f0d9fdcfda282efbe83b37b038f960f49be8a282dac24ef9
7
- data.tar.gz: 02c7a18a8f8fc88a35db3b6025bfefb434c5ec94787e494f744e2a5190c683bda6d17c9294446250ad4e3b4c9ab918b259ff03b13572e6bfa53fb6930ae43172
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
- field :id, field: GraphQL::Relay::GlobalIdField.new('#{model.to_s}')
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: "field :id, field: GraphQL::Relay::GlobalIdField.new('#{model.to_s}')\n" do <<-FILE
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
-
@@ -12,4 +12,4 @@ NodeIdentification = GraphQL::Relay::GlobalNodeIdentification.define do
12
12
  type_from_object -> (object) do
13
13
  (object.class.name + 'Type').constantize
14
14
  end
15
- end
15
+ end
@@ -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
@@ -4,5 +4,5 @@ RootLevelType = GraphQL::ObjectType.define do
4
4
 
5
5
  interfaces [NodeIdentification.interface]
6
6
 
7
- field :id, field: GraphQL::Relay::GlobalIdField.new('RootLevel')
8
- end
7
+ global_id_field :id
8
+ end
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.2
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-09 00:00:00.000000000 Z
11
+ date: 2016-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails