search_object_graphql 1.0.4 → 1.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41da46a65689f3f9178a8e4848df69af6e03c97e8afb30560d33bafda1562b2b
4
- data.tar.gz: 986e0d43576c42487751cfbc391caca2ec1cf694f6f16c9cb668d6d778570546
3
+ metadata.gz: 5e72c8cd390c7503160dbf8ba0e59b309f20d8c7b865ef4549eea4dc13e9c9be
4
+ data.tar.gz: 4b46d8d74225b2ec2c0a3e3bfe47f7bdcff06130b7c4456132b24af733ba9ead
5
5
  SHA512:
6
- metadata.gz: f81ce9688f696bc17e0b4fbefdc7b8d2caa8defbebe637d5a45f980cc5ac40c9d065310414d1e96134fe0cc4a08b67a4b7cecfff04d01be293e93e8dccf5b43f
7
- data.tar.gz: f0554a519c7248862329c7ce4a39667e167718e3daa5be221c8cbbac4293b35fc18c27a68f7adbb8b2994170207694130e9da8f41f0690680fab54bb9ac3c9e0
6
+ metadata.gz: c5294a9c135e4d18fd218ef3eb2588a6d517b66c6e92b6515d2df3cf56eeb6c34f8cc55d92f0714672167d798dfbc1ca142b7046cba20fd0107d7e0687c589a4
7
+ data.tar.gz: ac6e575a0c44dec6520abf262c2364dc0c2feea6dcab67434cdb51c83105bf4b7dd0582e8d4e926781706fa89ed7af7152a9f3c4e4b5c2d427b7b2c085108216
@@ -0,0 +1,33 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ matrix:
16
+ ruby-version: ['2.6', '2.7', '3.0', '3.1']
17
+
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+ - name: Set up Ruby ${{ matrix.ruby-version }}
21
+ uses: ruby/setup-ruby@0a29871fe2b0200a17a4497bae54fe5df0d973aa # v1.115.3
22
+ with:
23
+ ruby-version: ${{ matrix.ruby-version }}
24
+
25
+ - name: Install dependencies
26
+ run: bundle install
27
+
28
+ - name: Run linters
29
+ run: bundle exec rubocop
30
+
31
+ - name: Run tests
32
+ run: bundle exec rspec spec
33
+
data/.rubocop.yml CHANGED
@@ -6,6 +6,10 @@ AllCops:
6
6
  - example/config/**/*
7
7
  - search_object.gemspec
8
8
 
9
+ NewCops: disable
10
+ SuggestExtensions: false
11
+
12
+
9
13
  # Disables "Line is too long"
10
14
  Metrics/LineLength:
11
15
  Enabled: false
@@ -55,3 +59,12 @@ Metrics/CyclomaticComplexity:
55
59
 
56
60
  Metrics/PerceivedComplexity:
57
61
  Enabled: false
62
+
63
+ Style/HashSyntax:
64
+ Enabled: false
65
+
66
+ Style/TrailingCommaInHashLiteral:
67
+ Enabled: false
68
+
69
+ Gemspec/RequiredRubyVersion:
70
+ Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.6
1
+ 3.1.2
data/CHANGELOG.md CHANGED
@@ -1,46 +1,50 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 1.0.5
4
+
5
+ * __[fix]__ Use `resolve` instead `resolve_with_support`, which is a private method ([@thayol](https://github.com/thayol))
6
+
3
7
  ## Version 1.0.4
4
8
 
5
- * __[feature]__ Added `deprecation_reason` to `option` (@IgrekYY)
9
+ * __[feature]__ Added `deprecation_reason` to `option` ([@IgrekYY](https://github.com/IgrekYY))
6
10
 
7
11
  ## Version 1.0.3
8
12
 
9
- * __[fix]__ Support GraphQL 2.0 gem (@rstankov)
13
+ * __[fix]__ Support GraphQL 2.0 gem ([@rstankov](https://github.com/rstankov))
10
14
 
11
15
  ## Version 1.0.2
12
16
 
13
- * __[feature]__ Added `argument_options` to `option` (@wuz)
17
+ * __[feature]__ Added `argument_options` to `option` ([@wuz](https://github.com/wuz))
14
18
 
15
19
  ## Version 1.0.1
16
20
 
17
- * __[fix]__ `camelize` defaults to false when not specified (@haines)
21
+ * __[fix]__ `camelize` defaults to false when not specified ([@haines](https://github.com/haines))
18
22
 
19
23
  ## Version 1.0.0
20
24
 
21
- * __[break]__ Removed support for defining types via `type` method (@rstankov)
22
- * __[break]__ Require `GraphQL::Schema::Resolver` inheritance (@rstankov)
23
- * __[break]__ Removed support for legacy `GraphQL::Function` (@rstankov)
24
- * __[break]__ `type` creates type based on `GraphQL::Schema::Object`, not the deprecated `GraphQL::ObjectType.define` (@rstankov)
25
+ * __[break]__ Removed support for defining types via `type` method ([@rstankov](https://github.com/rstankov))
26
+ * __[break]__ Require `GraphQL::Schema::Resolver` inheritance ([@rstankov](https://github.com/rstankov))
27
+ * __[break]__ Removed support for legacy `GraphQL::Function` ([@rstankov](https://github.com/rstankov))
28
+ * __[break]__ `type` creates type based on `GraphQL::Schema::Object`, not the deprecated `GraphQL::ObjectType.define` ([@rstankov](https://github.com/rstankov))
25
29
 
26
30
  ## Version 0.3.2
27
31
 
28
- * __[feature]__ Added `camelize` argument to `option`, *`true` by default* (@glenbray)
32
+ * __[feature]__ Added `camelize` argument to `option`, *`true` by default* ([@glenbray](https://github.com/glenbray))
29
33
 
30
34
  ## Version 0.3.1
31
35
 
32
- * __[fix]__ Support for GraphQL gem version v1.9.16 (@ardinusawan)
36
+ * __[fix]__ Support for GraphQL gem version v1.9.16 ([@ardinusawan](https://github.com/ardinusawan))
33
37
 
34
38
  ## Version 0.3
35
39
 
36
- * __[feature]__ Allow passing `required` key to option definition (@vfonic)
37
- * __[fix]__ Support for GraphQL gem enums (@Postmodum37)
40
+ * __[feature]__ Allow passing `required` key to option definition ([@vfonic](https://github.com/vfonic))
41
+ * __[fix]__ Support for GraphQL gem enums ([@Postmodum37](https://github.com/Postmodum37))
38
42
 
39
43
  ## Version 0.2
40
44
 
41
- * Added support for GraphQL::Schema::Resolver (@rstankov)
42
- * Added support for GraphQL 1.8 class API (@rstankov)
45
+ * Added support for GraphQL::Schema::Resolver ([@rstankov](https://github.com/rstankov))
46
+ * Added support for GraphQL 1.8 class API ([@rstankov](https://github.com/rstankov))
43
47
 
44
48
  ## Version 0.1
45
49
 
46
- * Initial release (@rstankov)
50
+ * Initial release ([@rstankov](https://github.com/rstankov))
data/README.md CHANGED
@@ -1,28 +1,11 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/search_object_graphql.svg)](http://badge.fury.io/rb/search_object_graphql)
2
2
  [![Code Climate](https://codeclimate.com/github/RStankov/SearchObjectGraphQL.svg)](https://codeclimate.com/github/RStankov/SearchObjectGraphQL)
3
- [![Build Status](https://secure.travis-ci.org/RStankov/SearchObjectGraphQL.svg)](http://travis-ci.org/RStankov/SearchObjectGraphQL)
4
3
  [![Code coverage](https://coveralls.io/repos/RStankov/SearchObjectGraphQL/badge.svg?branch=master#2)](https://coveralls.io/r/RStankov/SearchObjectGraphQL)
5
4
 
6
5
  # SearchObject::Plugin::GraphQL
7
6
 
8
7
  [SearchObject](https://github.com/RStankov/SearchObject) plugin for [GraphQL Ruby](https://rmosolgo.github.io/graphql-ruby/).
9
8
 
10
- ## Table of Contents
11
-
12
- * [Installation](#installation)
13
- * [Dependencies](#dependencies)
14
- * [Usage](#usage)
15
- * [Example](#example)
16
- * [Features](#features)
17
- * [Custom Types](#custom-types)
18
- * [Documentation](#documentation)
19
- * [Default Values](#default-values)
20
- * [Accessing Parent Object](#accessing-parent-object)
21
- * [Enums Support](#enums-support)
22
- * [Relay Support](#relay-support)
23
- * [Contributing](#contributing)
24
- * [License](#license)
25
-
26
9
  ## Installation
27
10
 
28
11
  Add this line to your application's Gemfile:
@@ -52,6 +35,10 @@ require 'search_object/plugin/graphql'
52
35
  - `SearchObject` >= 1.2
53
36
  - `Graphql` >= 1.5
54
37
 
38
+ ## Changelog
39
+
40
+ Changes are available in [CHANGELOG.md](https://github.com/RStankov/SearchObjectGraphQL/blob/master/CHANGELOG.md)
41
+
55
42
  ## Usage
56
43
 
57
44
  Just include the ```SearchObject.module``` and define your search options and their types:
@@ -195,6 +182,20 @@ end
195
182
  field :posts, resolver: PostResolver
196
183
  ```
197
184
 
185
+ ## Running tests
186
+
187
+ Make sure all dependencies are installed with `bundle install`
188
+
189
+ ```
190
+ rake
191
+ ```
192
+
193
+ ## Release
194
+
195
+ ```
196
+ rake release
197
+ ```
198
+
198
199
  ## Contributing
199
200
 
200
201
  1. Fork it
@@ -204,6 +205,12 @@ field :posts, resolver: PostResolver
204
205
  5. Run the tests (`rake`)
205
206
  6. Create new Pull Request
206
207
 
208
+ ## Authors
209
+
210
+ * **Radoslav Stankov** - *creator* - [RStankov](https://github.com/RStankov)
211
+
212
+ See also the list of [contributors](https://github.com/RStankov/SearchObjectGraphQL/contributors) who participated in this project.
213
+
207
214
  ## License
208
215
 
209
216
  **[MIT License](https://github.com/RStankov/SearchObjectGraphQL/blob/master/LICENSE.txt)**
@@ -1 +1 @@
1
- 2.5.1
1
+ 3.1.2
data/example/Gemfile CHANGED
@@ -7,18 +7,11 @@ git_source(:github) do |repo_name|
7
7
  "https://github.com/#{repo_name}.git"
8
8
  end
9
9
 
10
- gem 'rails', '~> 5.2.0'
10
+ gem 'rails', '~> 7.0.0'
11
11
 
12
12
  gem 'graphql'
13
13
  gem 'puma', '~> 3.7'
14
14
  gem 'search_object'
15
15
  gem 'sqlite3'
16
16
 
17
- group :development do
18
- gem 'listen', '>= 3.0.5', '< 3.2'
19
- # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
20
- gem 'spring'
21
- gem 'spring-watcher-listen', '~> 2.0.0'
22
- end
23
-
24
17
  gem 'graphiql-rails', group: :development
data/example/README.md CHANGED
@@ -20,7 +20,7 @@ rails db:create
20
20
  rails db:migrate
21
21
  rails db:seed
22
22
 
23
- rails server
23
+ rails server -p 3000
24
24
  ```
25
25
 
26
26
  From there just visit: [localhost:3000/](http://localhost:3000/). This would open [graphiql](https://github.com/graphql/graphiql).
@@ -39,6 +39,7 @@ From there just visit: [localhost:3000/](http://localhost:3000/). This would ope
39
39
  node {
40
40
  id
41
41
  title
42
+ isPublished
42
43
  }
43
44
  }
44
45
  }
File without changes
@@ -32,11 +32,11 @@ Rails.application.configure do
32
32
  # Raise an error on page load if there are pending migrations.
33
33
  config.active_record.migration_error = :page_load
34
34
 
35
+ config.session_store :cookie_store, expire_after: 1.month.to_i
36
+
37
+ config.middleware.use ActionDispatch::Cookies
38
+ config.middleware.use config.session_store, config.session_options
35
39
 
36
40
  # Raises error for missing translations
37
41
  # config.action_view.raise_on_missing_translations = true
38
-
39
- # Use an evented file watcher to asynchronously detect changes in source code,
40
- # routes, locales, etc. This feature depends on the listen gem.
41
- config.file_watcher = ActiveSupport::EventedFileUpdateChecker
42
42
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Be sure to restart your server when you modify this file.
4
+
5
+ # Version of your assets, change this if you want to expire all your assets.
6
+ Rails.application.config.assets.version = '1.0'
7
+
8
+ # Add additional assets to the asset load path.
9
+ # Rails.application.config.assets.paths << Emoji.images_path
10
+
11
+ # Precompile additional assets.
12
+ # application.js, application.css, and all non-JS/CSS in the app/assets
13
+ # folder are already added.
14
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
15
+ Rails.application.config.assets.precompile += %w(graphiql/rails/application.css graphiql/rails/application.js)
data/example/db/schema.rb CHANGED
@@ -2,20 +2,19 @@
2
2
  # of editing this file, please use the migrations feature of Active Record to
3
3
  # incrementally modify your database, and then regenerate this schema definition.
4
4
  #
5
- # Note that this schema.rb definition is the authoritative source for your
6
- # database schema. If you need to create the application database on another
7
- # system, you should be using db:schema:load, not running all the migrations
8
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
- # you'll amass, the slower it'll run and the greater likelihood for issues).
5
+ # This file is the source Rails uses to define your schema when running `bin/rails
6
+ # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
+ # be faster and is potentially less error prone than running all of your
8
+ # migrations from scratch. Old migrations may fail to apply correctly if those
9
+ # migrations use external dependencies or application code.
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2017_05_07_175133) do
14
-
13
+ ActiveRecord::Schema[7.0].define(version: 2017_05_07_175133) do
15
14
  create_table "categories", force: :cascade do |t|
16
15
  t.string "name", null: false
17
- t.datetime "created_at", null: false
18
- t.datetime "updated_at", null: false
16
+ t.datetime "created_at", precision: nil, null: false
17
+ t.datetime "updated_at", precision: nil, null: false
19
18
  t.index ["name"], name: "index_categories_on_name", unique: true
20
19
  end
21
20
 
@@ -26,9 +25,9 @@ ActiveRecord::Schema.define(version: 2017_05_07_175133) do
26
25
  t.integer "views_count", default: 0, null: false
27
26
  t.integer "likes_count", default: 0, null: false
28
27
  t.integer "comments_count", default: 0, null: false
29
- t.datetime "published_at"
30
- t.datetime "created_at", null: false
31
- t.datetime "updated_at", null: false
28
+ t.datetime "published_at", precision: nil
29
+ t.datetime "created_at", precision: nil, null: false
30
+ t.datetime "updated_at", precision: nil, null: false
32
31
  t.index ["category_id"], name: "index_posts_on_category_id"
33
32
  t.index ["title"], name: "index_posts_on_title", unique: true
34
33
  end
@@ -3,7 +3,7 @@
3
3
  module SearchObject
4
4
  module Plugin
5
5
  module Graphql
6
- VERSION = '1.0.4'
6
+ VERSION = '1.0.5'
7
7
  end
8
8
  end
9
9
  end
@@ -15,13 +15,15 @@ module SearchObject
15
15
  def initialize(filters: {}, object: nil, context: {}, scope: nil, field: nil)
16
16
  @object = object
17
17
  @context = context
18
+ @field = field
19
+
20
+ @arguments_by_keyword = {}
18
21
 
19
22
  super filters: filters, scope: scope, field: field
20
23
  end
21
24
 
22
- # NOTE(rstankov): GraphQL::Schema::Resolver interface
23
- # Documentation - http://graphql-ruby.org/fields/resolvers.html#using-resolver
24
- def resolve_with_support(args = {})
25
+ # http://graphql-ruby.org/fields/resolvers.html#using-resolver
26
+ def resolve(args = {})
25
27
  self.params = args.to_h
26
28
  results
27
29
  end
@@ -21,11 +21,11 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ['lib']
22
22
 
23
23
  spec.add_dependency 'graphql', '> 1.8'
24
- spec.add_dependency 'search_object', '~> 1.2.2'
24
+ spec.add_dependency 'search_object', '~> 1.2.5'
25
25
 
26
26
  spec.add_development_dependency 'coveralls'
27
27
  spec.add_development_dependency 'rake'
28
28
  spec.add_development_dependency 'rspec', '~> 3.8'
29
- spec.add_development_dependency 'rubocop', '0.62.0'
30
- spec.add_development_dependency 'rubocop-rspec', '1.31.0'
29
+ spec.add_development_dependency 'rubocop', '1.41.1'
30
+ spec.add_development_dependency 'rubocop-rspec', '2.16.0'
31
31
  end
@@ -417,7 +417,6 @@ describe SearchObject::Plugin::Graphql do
417
417
  option('option', type: String, deprecation_reason: 'Not in use anymore')
418
418
  end
419
419
 
420
-
421
420
  result = schema.execute <<-SQL
422
421
  {
423
422
  __type(name: "Query") {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: search_object_graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Radoslav Stankov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-31 00:00:00.000000000 Z
11
+ date: 2023-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.2.2
33
+ version: 1.2.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.2.2
40
+ version: 1.2.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: coveralls
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.62.0
89
+ version: 1.41.1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 0.62.0
96
+ version: 1.41.1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubocop-rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 1.31.0
103
+ version: 2.16.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 1.31.0
110
+ version: 2.16.0
111
111
  description: Search Object plugin to working with GraphQL
112
112
  email:
113
113
  - rstankov@gmail.com
@@ -115,6 +115,7 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - ".github/workflows/ci.yml"
118
119
  - ".gitignore"
119
120
  - ".projections.json"
120
121
  - ".rspec"
@@ -131,6 +132,7 @@ files:
131
132
  - example/Gemfile
132
133
  - example/README.md
133
134
  - example/Rakefile
135
+ - example/app/assets/config/manifest.js
134
136
  - example/app/controllers/application_controller.rb
135
137
  - example/app/controllers/graphql_controller.rb
136
138
  - example/app/graphql/mutations/.keep
@@ -170,6 +172,7 @@ files:
170
172
  - example/config/environments/development.rb
171
173
  - example/config/environments/production.rb
172
174
  - example/config/environments/test.rb
175
+ - example/config/initializers/assets.rb
173
176
  - example/config/initializers/wrap_parameters.rb
174
177
  - example/config/puma.rb
175
178
  - example/config/routes.rb
@@ -192,7 +195,7 @@ homepage: https://github.com/RStankov/SearchObjectGraphQL
192
195
  licenses:
193
196
  - MIT
194
197
  metadata: {}
195
- post_install_message:
198
+ post_install_message:
196
199
  rdoc_options: []
197
200
  require_paths:
198
201
  - lib
@@ -207,8 +210,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
210
  - !ruby/object:Gem::Version
208
211
  version: '0'
209
212
  requirements: []
210
- rubygems_version: 3.1.6
211
- signing_key:
213
+ rubygems_version: 3.3.7
214
+ signing_key:
212
215
  specification_version: 4
213
216
  summary: Maps search objects to GraphQL resolvers
214
217
  test_files: