Skip to content

Commit 38768c1

Browse files
committed
Switch from CircleCI to Github Actions
1 parent 14f6159 commit 38768c1

23 files changed

+718
-197
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,8 @@ jobs:
2424
strategy:
2525
fail-fast: false
2626
matrix:
27-
appraisal: [ 'graphql-1.10', 'graphql-1.11', 'graphql-1.12', 'graphql-1.13', 'graphql-2.0' ]
28-
ruby: [ '3.0', '3.1', '3.2' ]
29-
exclude:
30-
- appraisal: 'graphql-1.10'
31-
ruby: '3.2'
32-
- appraisal: 'graphql-1.11'
33-
ruby: '3.2'
34-
- appraisal: 'graphql-1.12'
35-
ruby: '3.2'
27+
appraisal: [ 'graphql-1.13', 'graphql-2.0' ]
28+
ruby: [ '3.2', '3.3', '3.4' ]
3629
steps:
3730
- uses: actions/checkout@v4
3831
- uses: ruby/setup-ruby@v1
@@ -54,15 +47,8 @@ jobs:
5447
strategy:
5548
fail-fast: false
5649
matrix:
57-
appraisal: [ 'graphql-1.10', 'graphql-1.11', 'graphql-1.12', 'graphql-1.13', 'graphql-2.0' ]
58-
ruby: [ '3.0', '3.1', '3.2' ]
59-
exclude:
60-
- appraisal: 'graphql-1.10'
61-
ruby: '3.2'
62-
- appraisal: 'graphql-1.11'
63-
ruby: '3.2'
64-
- appraisal: 'graphql-1.12'
65-
ruby: '3.2'
50+
appraisal: [ 'graphql-1.13', 'graphql-2.0' ]
51+
ruby: [ '3.2', '3.3', '3.4' ]
6652
steps:
6753
- uses: actions/checkout@v4
6854
- uses: ruby/setup-ruby@v1

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.5
1+
3.2.2

Appraisals

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
# frozen_string_literal: true
22

3-
appraise 'graphql-1.10' do
4-
gem 'graphql', '1.10.14'
5-
end
6-
7-
appraise 'graphql-1.11' do
8-
gem 'graphql', '1.11.2'
9-
end
10-
11-
appraise 'graphql-1.12' do
12-
gem 'graphql', '1.12.5'
13-
end
14-
153
appraise 'graphql-1.13' do
164
gem 'graphql', '~> 1.13.6'
175
end
186

197
appraise 'graphql-2.0' do
208
gem 'graphql', '~> 2.0'
219
end
10+
11+
appraise 'graphql-2.3' do
12+
gem 'graphql', '~> 2.3'
13+
end

Gemfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@
33
source 'https://rubygems.org'
44

55
gemspec
6-
7-
gem 'appraisal', '~> 2.5.0'
8-
gem 'graphql', '~> 2.0.0'

Gemfile.lock

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ PATH
33
specs:
44
apollo-federation (3.10.0)
55
google-protobuf (< 5)
6-
graphql
6+
graphql (>= 1.10.14)
77

88
GEM
99
remote: https://rubygems.org/
@@ -30,14 +30,8 @@ GEM
3030
base64 (0.2.0)
3131
bigdecimal (3.1.9)
3232
builder (3.2.4)
33-
byebug (11.1.3)
34-
coderay (1.1.3)
3533
concurrent-ruby (1.2.2)
3634
crass (1.0.6)
37-
date (3.4.1)
38-
debug (1.10.0)
39-
irb (~> 1.10)
40-
reline (>= 0.3.8)
4135
diff-lcs (1.5.0)
4236
erubi (1.12.0)
4337
google-protobuf (4.29.3-arm64-darwin)
@@ -53,18 +47,12 @@ GEM
5347
base64
5448
i18n (1.12.0)
5549
concurrent-ruby (~> 1.0)
56-
io-console (0.8.0)
57-
irb (1.15.1)
58-
pp (>= 0.6.0)
59-
rdoc (>= 4.0.0)
60-
reline (>= 0.4.2)
6150
jaro_winkler (1.5.6)
6251
loofah (2.19.1)
6352
crass (~> 1.0.2)
6453
nokogiri (>= 1.5.9)
65-
method_source (1.1.0)
6654
minitest (5.18.0)
67-
mutex_m (0.3.0)
55+
mutex_m (0.1.2)
6856
nokogiri (1.18.2-arm64-darwin)
6957
racc (~> 1.4)
7058
nokogiri (1.18.2-x86_64-darwin)
@@ -75,18 +63,6 @@ GEM
7563
parallel (1.22.1)
7664
parser (3.2.1.1)
7765
ast (~> 2.4.1)
78-
pp (0.6.2)
79-
prettyprint
80-
prettyprint (0.2.0)
81-
pry (0.14.2)
82-
coderay (~> 1.1)
83-
method_source (~> 1.0)
84-
pry-byebug (3.10.1)
85-
byebug (~> 11.0)
86-
pry (>= 0.13, < 0.15)
87-
psych (5.2.3)
88-
date
89-
stringio
9066
racc (1.6.2)
9167
rack (2.2.6.4)
9268
rack-test (2.1.0)
@@ -101,10 +77,6 @@ GEM
10177
loofah (~> 2.19, >= 2.19.1)
10278
rainbow (3.1.1)
10379
rake (13.0.6)
104-
rdoc (6.11.0)
105-
psych (>= 4.0.0)
106-
reline (0.6.0)
107-
io-console (~> 0.5)
10880
rspec (3.12.0)
10981
rspec-core (~> 3.12.0)
11082
rspec-expectations (~> 3.12.0)
@@ -128,7 +100,6 @@ GEM
128100
rubocop-rspec (1.33.0)
129101
rubocop (>= 0.60.0)
130102
ruby-progressbar (1.13.0)
131-
stringio (3.1.2)
132103
tzinfo (2.0.6)
133104
concurrent-ruby (~> 1.0)
134105
unicode-display_width (1.6.1)
@@ -146,11 +117,9 @@ PLATFORMS
146117
DEPENDENCIES
147118
actionpack
148119
apollo-federation!
149-
debug
150-
graphql (~> 2.0.0)
120+
base64
151121
mutex_m
152122
ostruct
153-
pry-byebug
154123
rack
155124
rackup
156125
rake
@@ -160,4 +129,4 @@ DEPENDENCIES
160129
webrick
161130

162131
BUNDLED WITH
163-
2.6.3
132+
2.5.7

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,20 @@ class User < BaseObject
302302
end
303303
```
304304

305+
### The `@policy` directive (Apollo Federation v2)
306+
307+
[Apollo documentation](https://www.apollographql.com/docs/federation/federated-types/federated-directives/#policy)
308+
309+
Call `policy` within your class definition or pass the `policy:` option to your field definition:
310+
311+
```ruby
312+
class Product < BaseObject
313+
policy policies: [["stock:read"]]
314+
field :id, ID, null: false
315+
field :inStock, Boolean, null: false, policy: { policies: [["stock:read"]] }
316+
end
317+
```
318+
305319
### Field set syntax
306320

307321
Field sets can be either strings encoded with the Apollo Field Set [syntax]((https://www.apollographql.com/docs/apollo-server/federation/federation-spec/#scalar-_fieldset)) or arrays, hashes and snake case symbols that follow the graphql-ruby conventions:

apollo-federation.gemspec

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
1515
spec.description = spec.summary
1616
spec.homepage = 'https://github.com/Gusto/apollo-federation-ruby'
1717
spec.license = 'MIT'
18-
spec.required_ruby_version = '>= 2.2.0' # bc of `.to_sym`
18+
spec.required_ruby_version = '>= 3.2.0'
1919

2020
spec.metadata = {
2121
'homepage_uri' => 'https://github.com/Gusto/apollo-federation-ruby',
@@ -26,13 +26,10 @@ Gem::Specification.new do |spec|
2626

2727
spec.files = `git ls-files bin lib *.md LICENSE`.split("\n")
2828

29-
spec.add_dependency 'graphql'
30-
31-
spec.add_runtime_dependency 'google-protobuf', '< 5'
29+
spec.add_dependency 'google-protobuf', '< 5'
30+
spec.add_dependency 'graphql', '>= 1.10.14'
3231

3332
spec.add_development_dependency 'actionpack'
34-
spec.add_development_dependency 'debug'
35-
spec.add_development_dependency 'pry-byebug'
3633
spec.add_development_dependency 'rack'
3734
spec.add_development_dependency 'rackup'
3835
spec.add_development_dependency 'rake'
@@ -41,7 +38,8 @@ Gem::Specification.new do |spec|
4138
spec.add_development_dependency 'rubocop-rspec'
4239
spec.add_development_dependency 'webrick'
4340

44-
# TODO: 3.4 need to explicit add mutex_m and ostruct
41+
# Ruby 3.4 needs to explicitly add mutex_m, ostruct, and base64
42+
spec.add_development_dependency 'base64'
4543
spec.add_development_dependency 'mutex_m'
4644
spec.add_development_dependency 'ostruct'
4745
end

example/graphql_server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
require 'rack'
44
require 'json'
5+
require 'ostruct'
56
require 'graphql'
6-
require 'pry-byebug'
77
require 'apollo-federation'
88
require 'optparse'
99
require 'webrick'

gemfiles/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
BUNDLE_RETRY: "1"

gemfiles/graphql_1.13.gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "appraisal", "~> 2.5.0"
6+
gem "graphql", "~> 1.13.6"
7+
8+
gemspec path: "../"

0 commit comments

Comments
 (0)