Skip to content

Commit

Permalink
Merge branch 'master' of github.com:owen2345/graphql_preload_queries
Browse files Browse the repository at this point in the history
  • Loading branch information
owen2345 committed May 31, 2021
2 parents 176fd91 + 16a1e1c commit b430435
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ jobs:
run: |
bundle exec rspec
- name: Code style (Rubocop)
run: bundle exec rubocop
run: bundle exec rubocop
if: matrix.ruby == '2.5'
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require: rubocop-rspec
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.5

RSpec/FilePath:
Enabled: false
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.0 (30-05-2021)
- feat: refactor `include_gql_preloads` to auto calculate `query_key` and make it optional
- feat: support `:preload` option when defining a field

## 0.3.1 (22-01-2021)
- feat: auto camelize key for queries and mutations

Expand Down
2 changes: 1 addition & 1 deletion config/initializers/add_query_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# @param type_klass (GQL TypeClass, default: calculates using return type)
# @param query_key (String | Sym) Default method name
def include_gql_preloads(collection, query_key: nil, type_klass: nil)
query_key ||= caller_locations(1,1)[0].label
query_key ||= caller_locations(1, 1)[0].label
gql_result_key = GraphQL::Schema::Member::BuildType.camelize(query_key.to_s)
type_klass ||= preload_type_klass(gql_result_key.to_s)
klass = GraphqlPreloadQueries::Extensions::Preload
Expand Down
2 changes: 1 addition & 1 deletion graphql_preload_queries.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
spec.description = 'Permit to avoid N+1 queries problem when using graphql queries'
spec.homepage = 'https://github.com/owen2345/graphql_preload_queries'
spec.license = 'MIT'
spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')
spec.required_ruby_version = Gem::Requirement.new('>= 2.0') # rubocop:disable Gemspec/RequiredRubyVersion

# spec.metadata["allowed_push_host"] = ""

Expand Down

0 comments on commit b430435

Please sign in to comment.