graphql-relay 0.8.0 → 0.8.1

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: e48e815c037e952c8d1e2a9f54379b5bfbce7ae8
4
- data.tar.gz: 629bdf27a10511bdee0664304443b33f999581c9
3
+ metadata.gz: 263e38a956354abcb55e391c5bdd4b43367179db
4
+ data.tar.gz: ab2a35a584890faac7dac968c6c003ae5386168c
5
5
  SHA512:
6
- metadata.gz: 5b4a352c2405b890bc4a9b727f80f65f7f3e9c332162848b7fb41560147b4cf57597da9cc1739e47d15441f59528aa20ddba763201c5b58ffd50e1a1cedfaf71
7
- data.tar.gz: d630722d99ee1c605bf55df1554d23912ac3f3bb545ef89dd9a24bbd1bf267af25a6838dbf5e22a8d606d764422271aae2a931c3f7beec7050e78ae63d687b84
6
+ metadata.gz: 2ec4c12612f83c3cfc806a1c8906aef9030354cb54701e5889eca89de0e9b02f75143feebaabc6e5779bf8e5c41fe3fa666f22ec7bcc5f8f286ed59d13b8e813
7
+ data.tar.gz: 90be05474c434fcdc4e8ec367e592ed063c0d66fe920e9d1dc7962f5643d8a2b73b1d0c71f4f3afc61175ea5f71d53c6b357a2eb88809b3a71a6b7907484a93d
data/README.md CHANGED
@@ -97,7 +97,7 @@ NodeIdentification = GraphQL::Relay::GlobalNodeIdentification.define do
97
97
 
98
98
  # Return a string for re-fetching this object
99
99
  to_global_id -> (type_name, id) {
100
- "#{type_name.downcase}/#{id}"
100
+ "#{type_name}/#{id}"
101
101
  }
102
102
 
103
103
  # Based on the incoming string, extract the type_name and id
@@ -54,7 +54,7 @@ module GraphQL
54
54
  input_field: GraphQL::Define::AssignArgument,
55
55
  return_field: GraphQL::Define::AssignObjectField,
56
56
  )
57
- attr_accessor :name, :definition
57
+ attr_accessor :name, :description
58
58
  attr_reader :fields, :arguments
59
59
 
60
60
  # For backwards compat, but do we need this separate API?
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Relay
3
- VERSION = '0.8.0'
3
+ VERSION = '0.8.1'
4
4
  end
5
5
  end
@@ -98,13 +98,13 @@ describe GraphQL::Relay::GlobalNodeIdentification do
98
98
  it "Applies custom-defined ID generation" do
99
99
  result = query(%| { largestBase { id } }|)
100
100
  generated_id = result["data"]["largestBase"]["id"]
101
- assert_equal "Base/13", generated_id
101
+ assert_equal "Base/3", generated_id
102
102
  end
103
103
  end
104
104
 
105
105
  describe "fetching by ID" do
106
106
  it "Deconstructs the ID by the custom proc" do
107
- result = query(%| { node(id: "Base/11") { ... on Base { name } } }|)
107
+ result = query(%| { node(id: "Base/1") { ... on Base { name } } }|)
108
108
  base_name = result["data"]["node"]["name"]
109
109
  assert_equal "Yavin", base_name
110
110
  end
@@ -26,12 +26,11 @@ end
26
26
  class Base < ActiveRecord::Base
27
27
  end
28
28
 
29
- Base.create(id: 11, name: "Yavin", planet: "Yavin 4", faction_id: 1)
30
- Base.create(id: 12, name: "Echo Base", planet: "Hoth", faction_id: 1)
31
- Base.create(id: 13, name: "Death Star", planet: nil, faction_id: 2)
32
- Base.create(id: 14, name: "Shield Generator", planet: "Endor", faction_id: 2)
33
- Base.create(id: 15, name: "Headquarters", planet: "Coruscant", faction_id: 2)
34
-
29
+ Base.create!(name: "Yavin", planet: "Yavin 4", faction_id: 1)
30
+ Base.create!(name: "Echo Base", planet: "Hoth", faction_id: 1)
31
+ Base.create!(name: "Death Star", planet: nil, faction_id: 2)
32
+ Base.create!(name: "Shield Generator", planet: "Endor", faction_id: 2)
33
+ Base.create!(name: "Headquarters", planet: "Coruscant", faction_id: 2)
35
34
 
36
35
  rebels = OpenStruct.new({
37
36
  id: '1',
@@ -111,6 +111,7 @@ end
111
111
  IntroduceShipMutation = GraphQL::Relay::Mutation.define do
112
112
  # Used as the root for derived types:
113
113
  name "IntroduceShip"
114
+ description "Add a ship to this faction"
114
115
 
115
116
  # Nested under `input` in the query:
116
117
  input_field :shipName, !types.String
@@ -140,7 +141,7 @@ QueryType = GraphQL::ObjectType.define do
140
141
  end
141
142
 
142
143
  field :largestBase, BaseType do
143
- resolve -> (obj, args, ctx) { Base.find(13) }
144
+ resolve -> (obj, args, ctx) { Base.find(3) }
144
145
  end
145
146
 
146
147
  field :node, field: NodeIdentification.field
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-relay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-20 00:00:00.000000000 Z
11
+ date: 2016-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql