graphql-relay 0.4.3 → 0.4.4

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: 1038ccd66be579e1ade39b942de12fd993cbdc26
4
- data.tar.gz: 278b0a2e1dbbe0ddb15669e6fcfb0e4206bbab0f
3
+ metadata.gz: 3ef33be1f3e6ae5251b8ad8248e208b1d884bc80
4
+ data.tar.gz: 01b0b8d1d1e0ca687f1580b7b2d2e7f45303468f
5
5
  SHA512:
6
- metadata.gz: e8bf419f8e9c9c55d93a2c1efe15e3e66e81772ef04fe537046205d5d42f1c84bda9c690b3075625f6d80947d2b6fcce9df7032d98507219a70426af26db85ed
7
- data.tar.gz: ee7c7e669c03577c0924838f6a985b0639ee9008a5e0fbdfaa24eec75f3913e713b41eeb362802cf42eb2f32b2fd1ac851e74efdb6a2da9c59f2d5ea9ad97dd7
6
+ metadata.gz: cafa3a911d77401ba5bc525d1ccac55b388bfe861f12209c70d1bb47c62e08a423dee71512c0d6b860ed6260275a2d74a2f8dc91d94c397f676ce56d8528385f
7
+ data.tar.gz: 99234b626e2f8122d8bf304041bde214e4f8d5930176a255cd121f1b7fbd895e058d0d71a98e400ed2efe535ea41c8d3e2aa8dcfed5ef1428dd54a3eec986854
data/README.md CHANGED
@@ -72,8 +72,10 @@ Examples:
72
72
 
73
73
  ## Todo
74
74
 
75
- - Show how to replace default connection implementations with custom ones
76
75
  - Show how to wrap a simple field in a connection field with `ConnectionField.create`
76
+ - Add a `max_page_size` config for connections?
77
+ - Refactor some RelationConnection issues:
78
+ - fix [unbounded count in page info](https://github.com/rmosolgo/graphql-relay-ruby/blob/88b3d94f75a6dd4c8b2604743108db31f66f8dcc/lib/graphql/relay/base_connection.rb#L79-L86), [details](https://github.com/rmosolgo/graphql-relay-ruby/issues/1)
77
79
 
78
80
  ## More Resources
79
81
 
@@ -35,14 +35,14 @@ module GraphQL
35
35
  if after
36
36
  _o, order_value = slice_from_cursor(after)
37
37
  direction_marker = order_direction == :asc ? ">" : "<"
38
- where_condition = create_order_condition(order_name, order_value, direction_marker)
38
+ where_condition = create_order_condition(table_name, order_name, order_value, direction_marker)
39
39
  items = items.where(where_condition)
40
40
  end
41
41
 
42
42
  if before
43
43
  _o, order_value = slice_from_cursor(before)
44
44
  direction_marker = order_direction == :asc ? "<" : ">"
45
- where_condition = create_order_condition(order_name, order_value, direction_marker)
45
+ where_condition = create_order_condition(table_name, order_name, order_value, direction_marker)
46
46
  items = items.where(where_condition)
47
47
  end
48
48
 
@@ -64,10 +64,15 @@ module GraphQL
64
64
  def order_direction
65
65
  @order_direction ||= order.start_with?("-") ? :desc : :asc
66
66
  end
67
+
68
+ def table_name
69
+ @table_name ||= object.table.table_name
70
+ end
67
71
 
68
- def create_order_condition(column, value, direction_marker)
72
+ def create_order_condition(table, column, value, direction_marker)
73
+ table_name = ActiveRecord::Base.connection.quote_table_name(table)
69
74
  name = ActiveRecord::Base.connection.quote_column_name(column)
70
- ["#{name} #{direction_marker} ?", value]
75
+ ["#{table_name}.#{name} #{direction_marker} ?", value]
71
76
  end
72
77
  end
73
78
 
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Relay
3
- VERSION = '0.4.3'
3
+ VERSION = '0.4.4'
4
4
  end
5
5
  end
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.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-26 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql