graphql-relay 0.11.1 → 0.11.2
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/README.md +6 -12
- data/lib/graphql/relay/connection_field.rb +8 -6
- data/lib/graphql/relay/edge.rb +1 -2
- data/lib/graphql/relay/mutation.rb +2 -2
- data/lib/graphql/relay/page_info.rb +2 -2
- data/lib/graphql/relay/version.rb +1 -1
- 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: 510d5fdf6df3443f504f9f3500a72c123e66af12
|
4
|
+
data.tar.gz: 47490930231ee88bf559225d5ca1bcfdb660d537
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b0be8853c488bd84622a2c69bbaf5a0ff8b18c5bac9cd34dc57a2b9ed0d6368f5e16b0b12d9779a104b3472fa407a94a382173ffa8d27258152fed26c79d416
|
7
|
+
data.tar.gz: 445cfec2d8da0f8b5b57c580036e0621453e724313619783212a402542cb10ff161a45223d6f8968b709ed5f140624396c324c6fb54924f423ce2b4d32116825
|
data/README.md
CHANGED
@@ -433,18 +433,12 @@ The resolve proc:
|
|
433
433
|
- Takes `ctx`, which is the query context you passed with the `context:` keyword
|
434
434
|
- Must return a hash with keys matching your defined `return_field`s
|
435
435
|
|
436
|
-
##
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
https://medium.com/@gauravtiwari/graphql-and-relay-on-rails-first-relay-powered-react-component-cb3f9ee95eca
|
443
|
-
|
444
|
-
#### Tutorials
|
445
|
-
1. https://medium.com/@khor/relay-facebook-on-rails-8b4af2057152
|
446
|
-
2. http://mgiroux.me/2015/getting-started-with-rails-graphql-relay/
|
447
|
-
3. http://mgiroux.me/2015/uploading-files-using-relay-with-rails/
|
436
|
+
## Tutorials
|
437
|
+
|
438
|
+
- Building a blog in GraphQL and Relay on Rails [Introduction](https://medium.com/@gauravtiwari/graphql-and-relay-on-rails-getting-started-955a49d251de), [Part 1](https://medium.com/@gauravtiwari/graphql-and-relay-on-rails-creating-types-and-schema-b3f9b232ccfc), [Part 2](https://medium.com/@gauravtiwari/graphql-and-relay-on-rails-first-relay-powered-react-component-cb3f9ee95eca)
|
439
|
+
- https://medium.com/@khor/relay-facebook-on-rails-8b4af2057152
|
440
|
+
- http://mgiroux.me/2015/getting-started-with-rails-graphql-relay/
|
441
|
+
- http://mgiroux.me/2015/uploading-files-using-relay-with-rails/
|
448
442
|
|
449
443
|
## Todo
|
450
444
|
|
@@ -8,16 +8,18 @@ module GraphQL
|
|
8
8
|
# then a connection implementation is fetched with {BaseConnection.connection_for_items}.
|
9
9
|
class ConnectionField
|
10
10
|
ARGUMENT_DEFINITIONS = [
|
11
|
-
["first", GraphQL::INT_TYPE],
|
12
|
-
["after", GraphQL::STRING_TYPE],
|
13
|
-
["last", GraphQL::INT_TYPE],
|
14
|
-
["before", GraphQL::STRING_TYPE],
|
11
|
+
["first", GraphQL::INT_TYPE, "Returns the first _n_ elements from the list."],
|
12
|
+
["after", GraphQL::STRING_TYPE, "Returns the elements in the list that come after the specified global ID."],
|
13
|
+
["last", GraphQL::INT_TYPE, "Returns the last _n_ elements from the list."],
|
14
|
+
["before", GraphQL::STRING_TYPE, "Returns the elements in the list that come before the specified global ID."],
|
15
15
|
]
|
16
16
|
|
17
17
|
DEFAULT_ARGUMENTS = ARGUMENT_DEFINITIONS.reduce({}) do |memo, arg_defn|
|
18
18
|
argument = GraphQL::Argument.new
|
19
|
-
|
20
|
-
argument.
|
19
|
+
name, type, description = arg_defn
|
20
|
+
argument.name = name
|
21
|
+
argument.type = type
|
22
|
+
argument.description = description
|
21
23
|
memo[argument.name.to_s] = argument
|
22
24
|
memo
|
23
25
|
end
|
data/lib/graphql/relay/edge.rb
CHANGED
@@ -4,11 +4,10 @@ module GraphQL
|
|
4
4
|
#
|
5
5
|
# Wraps an object as a `node`, and exposes a connection-specific `cursor`.
|
6
6
|
class Edge < GraphQL::ObjectType
|
7
|
-
attr_reader :node, :
|
7
|
+
attr_reader :node, :connection
|
8
8
|
def initialize(node, connection)
|
9
9
|
@node = node
|
10
10
|
@connection = connection
|
11
|
-
@parent = parent
|
12
11
|
end
|
13
12
|
|
14
13
|
def cursor
|
@@ -94,7 +94,7 @@ module GraphQL
|
|
94
94
|
GraphQL::ObjectType.define do
|
95
95
|
name(type_name)
|
96
96
|
description("Autogenerated return type of #{mutation_name}")
|
97
|
-
field :clientMutationId, types.String
|
97
|
+
field :clientMutationId, types.String, "A unique identifier for the client performing the mutation."
|
98
98
|
type_fields.each do |name, field_obj|
|
99
99
|
field name, field: field_obj
|
100
100
|
end
|
@@ -110,7 +110,7 @@ module GraphQL
|
|
110
110
|
GraphQL::InputObjectType.define do
|
111
111
|
name(type_name)
|
112
112
|
description("Autogenerated input type of #{mutation_name}")
|
113
|
-
input_field :clientMutationId, types.String
|
113
|
+
input_field :clientMutationId, types.String, "A unique identifier for the client performing the mutation."
|
114
114
|
type_fields.each do |name, field_obj|
|
115
115
|
input_field name, field_obj.type, field_obj.description, default_value: field_obj.default_value
|
116
116
|
end
|
@@ -4,8 +4,8 @@ module GraphQL
|
|
4
4
|
PageInfo = GraphQL::ObjectType.define do
|
5
5
|
name("PageInfo")
|
6
6
|
description("Metadata about a connection")
|
7
|
-
field :hasNextPage, !types.Boolean, property: :has_next_page
|
8
|
-
field :hasPreviousPage, !types.Boolean, property: :has_previous_page
|
7
|
+
field :hasNextPage, !types.Boolean, "Indicates if there are more pages to fetch", property: :has_next_page
|
8
|
+
field :hasPreviousPage, !types.Boolean, "Indicates if there are any pages prior to the current page", property: :has_previous_page
|
9
9
|
end
|
10
10
|
end
|
11
11
|
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.11.
|
4
|
+
version: 0.11.2
|
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-06
|
11
|
+
date: 2016-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|