Graphql Admin client should not require a session argument
まだ誰も着手していません。
評価
調査の方向性
lib/shopify_api/clients/graphql/admin.rb から始め、その initializer を REST Admin Client の動作と比較してください。ドキュメント化された構築方法について docs/usage/custom_apps.md を確認し、session 引数がオプションかどうかについて実装とドキュメントの内容を一致させてください。完了条件は、ドキュメントに記載された初期化で引数エラーが発生しなくなることです。
索引モデルが issue の本文から書いたものです。
説明
The documentation at custom_apps.md indicates that you do not need to pass in a session argument when initializing a ShopifyAPI::Clients::Graphql::Admin client because it will use the active session (if it exists):
However, this example would raise an exception because the session argument is required:
# lib/shopify_api/clients/graphql/admin.rb
module ShopifyAPI
module Clients
module Graphql
class Admin < Client
sig { params(session: T.nilable(Auth::Session), api_version: T.nilable(String)).void }
def initialize(session:, api_version: nil) # session argument does not have a default value
super(session: session, base_path: "/admin/api", api_version: api_version)
end
end
end
end
end
Therefore if you want to use the active session, you have to pass in session: nil:
graphql_client = ShopifyAPI::Clients::Graphql::Admin.new(session: nil, api_version: "2024-07")
This seems counter-intuitive to me, as it makes it look like the code is deliberately saying it doesn't want to use a session. I think that what is shown in the documentation is how it should work, that you can omit the argument in order to use the active session. The REST Admin Client behaves this way, so I think it only makes sense that the Graphql Admin Client does too.
I can submit a PR to make this change if you'd like. Or if you disagree and want to keep the existing behavior, then I can submit a PR to fix the documentation.
- 主要言語
- Ruby
- スター
- 1.1k
- フォーク
- 484
- 平均マージ
- 4時間 38分
- マージ済み PR(30日)
- 1
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Shopify/shopify-api-ruby のほかの issue
-
devtools-gardener
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Shopify/shopify-api-ruby#1456 · リアクション 3 件 ·
-
devtools-gardener
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
Shopify/shopify-api-ruby#1461 · コメント 1 件 ·
-
automated
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Shopify/shopify-api-ruby#1460 ·
-
devtools-gardener
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
Shopify/shopify-api-ruby#1455 ·
-
devtools-gardener
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Shopify/shopify-api-ruby#1453 · コメント 1 件 ·
Shopify/shopify-api-ruby の issue をすべて見る
似ている issue
-
area/web interface
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
chef/mixlib-shellout#287 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信