Closed DenisCarriere closed 5 days ago
Latest commit: 78a4a90b4d7a5bce52cde98728fa8999a54d2cad
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Latest commit: |
78a4a90
|
Status: | ✅ Deploy successful! |
Preview URL: | https://742f6fc5.graph-tooling.pages.dev |
Branch Preview URL: | https://fix-website.graph-tooling.pages.dev |
After looking into it I feel like the proper way would be to use graph auth
to store the gateway API key.
There already exists graph auth
to store the deploy key for Studio. So introducing a separate flag just for publish
seems wrong.
graph auth
used to have --studio
and --hosted
flags. After removing Hosted service we removed both flags, so now it's only used to store Studio key
BTW in Studio it actually tells you to use --studio
, which doesn't work:
I propose returning --studio
flag to graph auth
and also adding --gateway
flag that would be used to store the gateway API key.
What do you think @alex-pakalniskis @0237h @DenisCarriere ?
Good point, I think it makes sense to have all API keys managed from a single command like auth
.
I propose returning --studio flag to graph auth and also adding --gateway flag that would be used to store the gateway API key.
@YaroShkvorets I'm wondering, aren't those technically the same keys ? Is there a technical reason you need to use different keys or could users use the same for both and this is more of an option ?
@DenisCarriere qualifies the gateway key as just the studio API key and from what I understand it is also treated as such on the Explorer (see pic)
These are different keys.
The key to publish subgraphs is sent to https://api.thegraph.com
. It's assigned to you by the Studio and it's not used for anything else.
The key to sent queries is sent to https://gateway.thegraph.com
and you can manage/rotate it.
--api-key
required for graph publish
when --subgraph-id
is suppliedAdded version extraction from network subgraph for an existing subgraph to properly update metadata.
fixes: https://github.com/graphprotocol/graph-tooling/issues/1753
CLI changes
--api-key
: The API key to use for the Subgraph queries.Example
Website changes
NETWORK_SUBGRAPH_MAINNET
with https://gateway.thegraph.com/api/{api-key}/subgraphs/id/DZz4kDTdmzWLWsV373w2bSmoar3umKKH9y82SUKr5qmpNETWORK_SUBGRAPH_SEPOLIA
with https://gateway.thegraph.com/api/{api-key}/subgraphs/id/3xQHhMudr1oh69ut36G2mbzpYmYxwqCeU6wwqyCDCnqV?apiKey=<STUDIO API KEY>
apiKey
is not provided in URL params