graphiti-rb 1.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/.travis.yml +20 -0
- data/.yardopts +2 -0
- data/Appraisals +11 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +12 -0
- data/Guardfile +32 -0
- data/LICENSE.txt +21 -0
- data/README.md +75 -0
- data/Rakefile +15 -0
- data/bin/appraisal +17 -0
- data/bin/console +14 -0
- data/bin/rspec +17 -0
- data/bin/setup +8 -0
- data/gemfiles/rails_4.gemfile +17 -0
- data/gemfiles/rails_5.gemfile +17 -0
- data/graphiti.gemspec +34 -0
- data/lib/generators/jsonapi/resource_generator.rb +169 -0
- data/lib/generators/jsonapi/templates/application_resource.rb.erb +15 -0
- data/lib/generators/jsonapi/templates/controller.rb.erb +61 -0
- data/lib/generators/jsonapi/templates/create_request_spec.rb.erb +30 -0
- data/lib/generators/jsonapi/templates/destroy_request_spec.rb.erb +20 -0
- data/lib/generators/jsonapi/templates/index_request_spec.rb.erb +22 -0
- data/lib/generators/jsonapi/templates/resource.rb.erb +11 -0
- data/lib/generators/jsonapi/templates/resource_reads_spec.rb.erb +62 -0
- data/lib/generators/jsonapi/templates/resource_writes_spec.rb.erb +63 -0
- data/lib/generators/jsonapi/templates/show_request_spec.rb.erb +21 -0
- data/lib/generators/jsonapi/templates/update_request_spec.rb.erb +34 -0
- data/lib/graphiti-rb.rb +1 -0
- data/lib/graphiti.rb +121 -0
- data/lib/graphiti/adapters/abstract.rb +516 -0
- data/lib/graphiti/adapters/active_record.rb +6 -0
- data/lib/graphiti/adapters/active_record/base.rb +249 -0
- data/lib/graphiti/adapters/active_record/belongs_to_sideload.rb +17 -0
- data/lib/graphiti/adapters/active_record/has_many_sideload.rb +17 -0
- data/lib/graphiti/adapters/active_record/has_one_sideload.rb +17 -0
- data/lib/graphiti/adapters/active_record/inferrence.rb +12 -0
- data/lib/graphiti/adapters/active_record/many_to_many_sideload.rb +30 -0
- data/lib/graphiti/adapters/null.rb +236 -0
- data/lib/graphiti/base.rb +70 -0
- data/lib/graphiti/configuration.rb +21 -0
- data/lib/graphiti/context.rb +16 -0
- data/lib/graphiti/deserializer.rb +208 -0
- data/lib/graphiti/errors.rb +309 -0
- data/lib/graphiti/extensions/boolean_attribute.rb +33 -0
- data/lib/graphiti/extensions/extra_attribute.rb +70 -0
- data/lib/graphiti/extensions/temp_id.rb +26 -0
- data/lib/graphiti/filter_operators.rb +25 -0
- data/lib/graphiti/hash_renderer.rb +57 -0
- data/lib/graphiti/jsonapi_serializable_ext.rb +50 -0
- data/lib/graphiti/query.rb +251 -0
- data/lib/graphiti/rails.rb +28 -0
- data/lib/graphiti/railtie.rb +74 -0
- data/lib/graphiti/renderer.rb +60 -0
- data/lib/graphiti/resource.rb +110 -0
- data/lib/graphiti/resource/configuration.rb +239 -0
- data/lib/graphiti/resource/dsl.rb +138 -0
- data/lib/graphiti/resource/interface.rb +32 -0
- data/lib/graphiti/resource/polymorphism.rb +68 -0
- data/lib/graphiti/resource/sideloading.rb +102 -0
- data/lib/graphiti/resource_proxy.rb +127 -0
- data/lib/graphiti/responders.rb +19 -0
- data/lib/graphiti/runner.rb +25 -0
- data/lib/graphiti/scope.rb +98 -0
- data/lib/graphiti/scoping/base.rb +99 -0
- data/lib/graphiti/scoping/default_filter.rb +58 -0
- data/lib/graphiti/scoping/extra_attributes.rb +29 -0
- data/lib/graphiti/scoping/filter.rb +93 -0
- data/lib/graphiti/scoping/filterable.rb +36 -0
- data/lib/graphiti/scoping/paginate.rb +87 -0
- data/lib/graphiti/scoping/sort.rb +64 -0
- data/lib/graphiti/sideload.rb +281 -0
- data/lib/graphiti/sideload/belongs_to.rb +34 -0
- data/lib/graphiti/sideload/has_many.rb +16 -0
- data/lib/graphiti/sideload/has_one.rb +9 -0
- data/lib/graphiti/sideload/many_to_many.rb +24 -0
- data/lib/graphiti/sideload/polymorphic_belongs_to.rb +108 -0
- data/lib/graphiti/stats/dsl.rb +89 -0
- data/lib/graphiti/stats/payload.rb +49 -0
- data/lib/graphiti/types.rb +172 -0
- data/lib/graphiti/util/attribute_check.rb +88 -0
- data/lib/graphiti/util/field_params.rb +16 -0
- data/lib/graphiti/util/hash.rb +51 -0
- data/lib/graphiti/util/hooks.rb +33 -0
- data/lib/graphiti/util/include_params.rb +39 -0
- data/lib/graphiti/util/persistence.rb +219 -0
- data/lib/graphiti/util/relationship_payload.rb +64 -0
- data/lib/graphiti/util/serializer_attributes.rb +97 -0
- data/lib/graphiti/util/sideload.rb +33 -0
- data/lib/graphiti/util/validation_response.rb +78 -0
- data/lib/graphiti/version.rb +3 -0
- metadata +317 -0
@@ -0,0 +1,64 @@
|
|
1
|
+
module Graphiti
|
2
|
+
module Util
|
3
|
+
# Helper methods for traversing the 'relationships' JSONAPI payloads
|
4
|
+
# @api private
|
5
|
+
class RelationshipPayload
|
6
|
+
attr_reader :resource, :payload
|
7
|
+
|
8
|
+
def self.iterate(resource:, relationships: {}, only: [], except: [])
|
9
|
+
instance = new(resource, relationships, only: only, except: except)
|
10
|
+
instance.iterate do |sideload, relationship_data, sub_relationships|
|
11
|
+
yield sideload, relationship_data, sub_relationships
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def initialize(resource, payload, only: [], except: [])
|
16
|
+
@resource = resource
|
17
|
+
@payload = payload
|
18
|
+
@only = only
|
19
|
+
@except = except
|
20
|
+
end
|
21
|
+
|
22
|
+
def iterate
|
23
|
+
payload.each_pair do |relationship_name, relationship_payload|
|
24
|
+
if sl = resource.class.sideload(relationship_name.to_sym)
|
25
|
+
if should_yield?(sl.type)
|
26
|
+
if relationship_payload.is_a?(Array)
|
27
|
+
relationship_payload.each do |rp|
|
28
|
+
yield payload_for(sl, rp)
|
29
|
+
end
|
30
|
+
else
|
31
|
+
yield payload_for(sl, relationship_payload)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def should_yield?(type)
|
41
|
+
(@only.length > 0 && @only.include?(type)) ||
|
42
|
+
(@except.length > 0 && !@except.include?(type))
|
43
|
+
end
|
44
|
+
|
45
|
+
def payload_for(sideload, relationship_payload)
|
46
|
+
if sideload.polymorphic_parent?
|
47
|
+
type = relationship_payload[:meta][:jsonapi_type]
|
48
|
+
sideload = sideload.child_for_type(type.to_sym)
|
49
|
+
end
|
50
|
+
relationship_payload[:meta][:method] ||= :update
|
51
|
+
|
52
|
+
{
|
53
|
+
sideload: sideload,
|
54
|
+
is_polymorphic: sideload.polymorphic_child?,
|
55
|
+
primary_key: sideload.primary_key,
|
56
|
+
foreign_key: sideload.foreign_key,
|
57
|
+
attributes: relationship_payload[:attributes],
|
58
|
+
meta: relationship_payload[:meta],
|
59
|
+
relationships: relationship_payload[:relationships]
|
60
|
+
}
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
module Graphiti
|
2
|
+
module Util
|
3
|
+
class SerializerAttribute
|
4
|
+
def initialize(name, attr, resource, serializer, extra)
|
5
|
+
@name = name
|
6
|
+
@attr = attr
|
7
|
+
@resource = resource
|
8
|
+
@serializer = serializer
|
9
|
+
@extra = extra
|
10
|
+
end
|
11
|
+
|
12
|
+
def apply
|
13
|
+
return unless readable?
|
14
|
+
|
15
|
+
if @name == :id
|
16
|
+
@serializer.id(&@attr[:proc]) if @attr[:proc]
|
17
|
+
elsif @attr[:proc]
|
18
|
+
@serializer.send(_method, @name, serializer_options, &proc)
|
19
|
+
else
|
20
|
+
if @serializer.attribute_blocks[@name].nil?
|
21
|
+
@serializer.send(_method, @name, serializer_options, &proc)
|
22
|
+
else
|
23
|
+
inner = @serializer.attribute_blocks.delete(@name)
|
24
|
+
wrapped = wrap_proc(inner)
|
25
|
+
@serializer.send(_method, @name, serializer_options, &wrapped)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def _method
|
33
|
+
extra? ? :extra_attribute : :attribute
|
34
|
+
end
|
35
|
+
|
36
|
+
def extra?
|
37
|
+
!!@extra
|
38
|
+
end
|
39
|
+
|
40
|
+
def readable?
|
41
|
+
!!@attr[:readable]
|
42
|
+
end
|
43
|
+
|
44
|
+
def guard
|
45
|
+
_method = @attr[:readable]
|
46
|
+
instance = @resource.new
|
47
|
+
-> { instance.instance_eval(&_method) }
|
48
|
+
end
|
49
|
+
|
50
|
+
def guard?
|
51
|
+
@attr[:readable] != true
|
52
|
+
end
|
53
|
+
|
54
|
+
def serializer_options
|
55
|
+
{}.tap do |opts|
|
56
|
+
opts[:if] = guard if guard?
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def default_proc
|
61
|
+
_name = @name
|
62
|
+
_resource = @resource.new
|
63
|
+
->(_) {
|
64
|
+
_resource.typecast(_name, @object.send(_name), :readable)
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
def wrap_proc(inner)
|
69
|
+
type_name = @attr[:type]
|
70
|
+
->(serializer_instance = nil) {
|
71
|
+
type = Graphiti::Types[type_name]
|
72
|
+
type[:read][serializer_instance.instance_eval(&inner)]
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
def proc
|
77
|
+
@attr[:proc] ? wrap_proc(@attr[:proc]) : default_proc
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
class SerializerAttributes
|
82
|
+
def initialize(resource, attributes, extra = false)
|
83
|
+
@resource = resource
|
84
|
+
@serializer = resource.serializer
|
85
|
+
@attributes = attributes
|
86
|
+
@extra = extra
|
87
|
+
end
|
88
|
+
|
89
|
+
def apply
|
90
|
+
@attributes.each_pair do |name, attr|
|
91
|
+
SerializerAttribute
|
92
|
+
.new(name, attr, @resource, @serializer, @extra).apply
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Graphiti
|
2
|
+
module Util
|
3
|
+
# @api private
|
4
|
+
class Sideload
|
5
|
+
# Determine the namespace for the sideload
|
6
|
+
#
|
7
|
+
# In other words, given a query like
|
8
|
+
# /things?include=a.b
|
9
|
+
#
|
10
|
+
# When 'a' is sideloading 'b', b's namespace is 'b'.
|
11
|
+
#
|
12
|
+
# However, consider a recursive tree structure:
|
13
|
+
#
|
14
|
+
# /things?include=children.children
|
15
|
+
#
|
16
|
+
# The first occurrance of "children" will have the namespace
|
17
|
+
# "children", the second will be "children.children" and so forth.
|
18
|
+
#
|
19
|
+
# This is used to match up other criteria in the query:
|
20
|
+
#
|
21
|
+
# ?filter[children.children][a]=b
|
22
|
+
#
|
23
|
+
# @api private
|
24
|
+
def self.namespace(a, b)
|
25
|
+
if a.to_s.split('.')[0] == b.to_s
|
26
|
+
:"#{a}.#{b}"
|
27
|
+
else
|
28
|
+
b
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# We need to know two things in the response of a persistence call:
|
2
|
+
#
|
3
|
+
# * The model we just tried to persist
|
4
|
+
# * Was the persistence successful?
|
5
|
+
#
|
6
|
+
# This object wraps those bits of data. The call is considered
|
7
|
+
# unsuccessful when it adheres to the ActiveModel#errors interface,
|
8
|
+
# and #errors is not blank. In other words, it is not successful if
|
9
|
+
# there were validation errors.
|
10
|
+
#
|
11
|
+
# @attr_reader object the object we are saving
|
12
|
+
class Graphiti::Util::ValidationResponse
|
13
|
+
attr_reader :object
|
14
|
+
|
15
|
+
# @param object the model instance we tried to save
|
16
|
+
# @param deserialized_params see Base#deserialized_params
|
17
|
+
def initialize(object, deserialized_params)
|
18
|
+
@object = object
|
19
|
+
@deserialized_params = deserialized_params
|
20
|
+
end
|
21
|
+
|
22
|
+
# Check to ensure no validation errors.
|
23
|
+
# @return [Boolean] did the persistence call succeed?
|
24
|
+
def success?
|
25
|
+
all_valid?(object, relationships)
|
26
|
+
end
|
27
|
+
|
28
|
+
# @return [Array] the object and success state
|
29
|
+
def to_a
|
30
|
+
[object, success?]
|
31
|
+
end
|
32
|
+
|
33
|
+
def validate!
|
34
|
+
unless success?
|
35
|
+
raise ::Graphiti::Errors::ValidationError.new(self)
|
36
|
+
end
|
37
|
+
self
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def relationships
|
43
|
+
if @deserialized_params
|
44
|
+
@deserialized_params.relationships
|
45
|
+
else
|
46
|
+
{}
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def valid_object?(object)
|
51
|
+
!object.respond_to?(:errors) ||
|
52
|
+
(object.respond_to?(:errors) && object.errors.blank?)
|
53
|
+
end
|
54
|
+
|
55
|
+
def all_valid?(model, deserialized_params)
|
56
|
+
valid = true
|
57
|
+
return false unless valid_object?(model)
|
58
|
+
deserialized_params.each_pair do |name, payload|
|
59
|
+
if payload.is_a?(Array)
|
60
|
+
related_objects = model.send(name)
|
61
|
+
related_objects.each do |r|
|
62
|
+
valid = valid_object?(r)
|
63
|
+
|
64
|
+
if valid
|
65
|
+
valid = all_valid?(r, deserialized_params[:relationships] || {})
|
66
|
+
end
|
67
|
+
end
|
68
|
+
else
|
69
|
+
related_object = model.send(name)
|
70
|
+
valid = valid_object?(related_object)
|
71
|
+
if valid
|
72
|
+
valid = all_valid?(related_object, deserialized_params[:relationships] || {})
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
valid
|
77
|
+
end
|
78
|
+
end
|
metadata
ADDED
@@ -0,0 +1,317 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: graphiti-rb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.alpha.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Lee Richmond
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-07-31 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: jsonapi-serializable
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.3.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.3.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: dry-types
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.13'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.13'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: jsonapi_errorable
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.9'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.9'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: concurrent-ruby
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activerecord
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '4.1'
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '6'
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '4.1'
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '6'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: kaminari
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0.17'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0.17'
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: bundler
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '1.12'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '1.12'
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: rake
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - "~>"
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '10.0'
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - "~>"
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '10.0'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: sqlite3
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: database_cleaner
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
type: :development
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: activemodel
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '4.1'
|
166
|
+
- - "<"
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '6'
|
169
|
+
type: :development
|
170
|
+
prerelease: false
|
171
|
+
version_requirements: !ruby/object:Gem::Requirement
|
172
|
+
requirements:
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '4.1'
|
176
|
+
- - "<"
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: '6'
|
179
|
+
- !ruby/object:Gem::Dependency
|
180
|
+
name: jsonapi_spec_helpers
|
181
|
+
requirement: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - ">="
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: 1.0.alpha.1
|
186
|
+
type: :development
|
187
|
+
prerelease: false
|
188
|
+
version_requirements: !ruby/object:Gem::Requirement
|
189
|
+
requirements:
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: 1.0.alpha.1
|
193
|
+
description:
|
194
|
+
email:
|
195
|
+
- richmolj@gmail.com
|
196
|
+
executables: []
|
197
|
+
extensions: []
|
198
|
+
extra_rdoc_files: []
|
199
|
+
files:
|
200
|
+
- ".gitignore"
|
201
|
+
- ".rspec"
|
202
|
+
- ".ruby-version"
|
203
|
+
- ".travis.yml"
|
204
|
+
- ".yardopts"
|
205
|
+
- Appraisals
|
206
|
+
- CODE_OF_CONDUCT.md
|
207
|
+
- Gemfile
|
208
|
+
- Guardfile
|
209
|
+
- LICENSE.txt
|
210
|
+
- README.md
|
211
|
+
- Rakefile
|
212
|
+
- bin/appraisal
|
213
|
+
- bin/console
|
214
|
+
- bin/rspec
|
215
|
+
- bin/setup
|
216
|
+
- gemfiles/rails_4.gemfile
|
217
|
+
- gemfiles/rails_5.gemfile
|
218
|
+
- graphiti.gemspec
|
219
|
+
- lib/generators/jsonapi/resource_generator.rb
|
220
|
+
- lib/generators/jsonapi/templates/application_resource.rb.erb
|
221
|
+
- lib/generators/jsonapi/templates/controller.rb.erb
|
222
|
+
- lib/generators/jsonapi/templates/create_request_spec.rb.erb
|
223
|
+
- lib/generators/jsonapi/templates/destroy_request_spec.rb.erb
|
224
|
+
- lib/generators/jsonapi/templates/index_request_spec.rb.erb
|
225
|
+
- lib/generators/jsonapi/templates/resource.rb.erb
|
226
|
+
- lib/generators/jsonapi/templates/resource_reads_spec.rb.erb
|
227
|
+
- lib/generators/jsonapi/templates/resource_writes_spec.rb.erb
|
228
|
+
- lib/generators/jsonapi/templates/show_request_spec.rb.erb
|
229
|
+
- lib/generators/jsonapi/templates/update_request_spec.rb.erb
|
230
|
+
- lib/graphiti-rb.rb
|
231
|
+
- lib/graphiti.rb
|
232
|
+
- lib/graphiti/adapters/abstract.rb
|
233
|
+
- lib/graphiti/adapters/active_record.rb
|
234
|
+
- lib/graphiti/adapters/active_record/base.rb
|
235
|
+
- lib/graphiti/adapters/active_record/belongs_to_sideload.rb
|
236
|
+
- lib/graphiti/adapters/active_record/has_many_sideload.rb
|
237
|
+
- lib/graphiti/adapters/active_record/has_one_sideload.rb
|
238
|
+
- lib/graphiti/adapters/active_record/inferrence.rb
|
239
|
+
- lib/graphiti/adapters/active_record/many_to_many_sideload.rb
|
240
|
+
- lib/graphiti/adapters/null.rb
|
241
|
+
- lib/graphiti/base.rb
|
242
|
+
- lib/graphiti/configuration.rb
|
243
|
+
- lib/graphiti/context.rb
|
244
|
+
- lib/graphiti/deserializer.rb
|
245
|
+
- lib/graphiti/errors.rb
|
246
|
+
- lib/graphiti/extensions/boolean_attribute.rb
|
247
|
+
- lib/graphiti/extensions/extra_attribute.rb
|
248
|
+
- lib/graphiti/extensions/temp_id.rb
|
249
|
+
- lib/graphiti/filter_operators.rb
|
250
|
+
- lib/graphiti/hash_renderer.rb
|
251
|
+
- lib/graphiti/jsonapi_serializable_ext.rb
|
252
|
+
- lib/graphiti/query.rb
|
253
|
+
- lib/graphiti/rails.rb
|
254
|
+
- lib/graphiti/railtie.rb
|
255
|
+
- lib/graphiti/renderer.rb
|
256
|
+
- lib/graphiti/resource.rb
|
257
|
+
- lib/graphiti/resource/configuration.rb
|
258
|
+
- lib/graphiti/resource/dsl.rb
|
259
|
+
- lib/graphiti/resource/interface.rb
|
260
|
+
- lib/graphiti/resource/polymorphism.rb
|
261
|
+
- lib/graphiti/resource/sideloading.rb
|
262
|
+
- lib/graphiti/resource_proxy.rb
|
263
|
+
- lib/graphiti/responders.rb
|
264
|
+
- lib/graphiti/runner.rb
|
265
|
+
- lib/graphiti/scope.rb
|
266
|
+
- lib/graphiti/scoping/base.rb
|
267
|
+
- lib/graphiti/scoping/default_filter.rb
|
268
|
+
- lib/graphiti/scoping/extra_attributes.rb
|
269
|
+
- lib/graphiti/scoping/filter.rb
|
270
|
+
- lib/graphiti/scoping/filterable.rb
|
271
|
+
- lib/graphiti/scoping/paginate.rb
|
272
|
+
- lib/graphiti/scoping/sort.rb
|
273
|
+
- lib/graphiti/sideload.rb
|
274
|
+
- lib/graphiti/sideload/belongs_to.rb
|
275
|
+
- lib/graphiti/sideload/has_many.rb
|
276
|
+
- lib/graphiti/sideload/has_one.rb
|
277
|
+
- lib/graphiti/sideload/many_to_many.rb
|
278
|
+
- lib/graphiti/sideload/polymorphic_belongs_to.rb
|
279
|
+
- lib/graphiti/stats/dsl.rb
|
280
|
+
- lib/graphiti/stats/payload.rb
|
281
|
+
- lib/graphiti/types.rb
|
282
|
+
- lib/graphiti/util/attribute_check.rb
|
283
|
+
- lib/graphiti/util/field_params.rb
|
284
|
+
- lib/graphiti/util/hash.rb
|
285
|
+
- lib/graphiti/util/hooks.rb
|
286
|
+
- lib/graphiti/util/include_params.rb
|
287
|
+
- lib/graphiti/util/persistence.rb
|
288
|
+
- lib/graphiti/util/relationship_payload.rb
|
289
|
+
- lib/graphiti/util/serializer_attributes.rb
|
290
|
+
- lib/graphiti/util/sideload.rb
|
291
|
+
- lib/graphiti/util/validation_response.rb
|
292
|
+
- lib/graphiti/version.rb
|
293
|
+
homepage:
|
294
|
+
licenses:
|
295
|
+
- MIT
|
296
|
+
metadata: {}
|
297
|
+
post_install_message:
|
298
|
+
rdoc_options: []
|
299
|
+
require_paths:
|
300
|
+
- lib
|
301
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
302
|
+
requirements:
|
303
|
+
- - ">="
|
304
|
+
- !ruby/object:Gem::Version
|
305
|
+
version: '0'
|
306
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
307
|
+
requirements:
|
308
|
+
- - ">"
|
309
|
+
- !ruby/object:Gem::Version
|
310
|
+
version: 1.3.1
|
311
|
+
requirements: []
|
312
|
+
rubyforge_project:
|
313
|
+
rubygems_version: 2.6.11
|
314
|
+
signing_key:
|
315
|
+
specification_version: 4
|
316
|
+
summary: Easily build jsonapi.org-compatible APIs
|
317
|
+
test_files: []
|