-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
patchedSubscription --> patch not enough information returned. #28
Comments
Identified Cases and IssuesCase 1:subscription {
nft(
where: {
spender: { _eq: 3654319 }
account_id: { _eq: 2665305 }
token_id: { _eq: 3515204 }
}
) {
token_id
serial_number
}
}
.In subscriptions:
- All data received
- Modify spender
.In subscriptions:
- All data received
- 🚀 ~ patches.forEach ~ patch: {"op":"remove","path":"/data/nft/103","value":{"token_id":3515204,"serial_number":170}} Case 2:subscription {
nft(where: { account_id: { _eq: 2665305 }, token_id: { _eq: 3515204 } }) {
token_id
serial_number
spender
}
}
.In subscriptions:
- All data received
- Modify spender
.In subscriptions:
- All data received
- patches.forEach ~ patch: {"op":"replace","path":"/data/nft/118/spender","value":null} Case 3:subscription {
nft(where: { account_id: { _eq: 2665305 }, token_id: { _eq: 3515204 } }) {
token_id
serial_number
}
}
.In subscriptions:
- All data received
- Modify spender
.In subscriptions:
- No patches received Case 4:subscription {
nft(
limit: 2
where: {
spender: { _eq: 3654319 }
account_id: { _eq: 2665305 }
token_id: { _eq: 3515204 }
}
) {
token_id
serial_number
spender
}
}
.In subscriptions:
- All data received
- Modify spender
.In subscriptions:
- No patches received Summary of Issues and Inconsistencies
ConclusionTo address these issues, it's crucial to:
|
We are using the JSON patch specification. Here is the library and tools we are importing - Line 4 in 90b2759
The number is the position in the in the array: You may consider writing subscriptions ONLY for the critical data you want to be notified on change vs. placing the whole query in a subscription. See https://www.apollographql.com/docs/react/data/subscriptions/#when-to-use-subscriptions |
@tmctl |
hi @pat-rg our API doesn't implement JSON Patch, so this code would need to be run on a server or on the client side. we can expose a relay endpoint - https://relay.dev. Maybe some features of this might help your use cases? |
Good morning,
I'm currently testing the new
patchedSubscriptions
to implement them in our DApps to improve performance, and I'm encountering a few issues:/data/entity_by_pk/token_account/39/token/total_supply
- New value:27282926759423626
. What does the39
aftertoken_account
refer to? How can I determine which token this new value belongs to? Given that we have numerous tokens, different balances, various public keys for each token, and different supplies for each token, I need each value to clearly identify a specific token. For instance, if a key changes, it should indicate what type of key it is.Is there a way to subscribe to a specific field? For example, there are too many different burns and mints on Hedera concerning FTs. I don't want to keep receiving notifications for each burn that occurs for each token ID, but I do want to get notifications when the balance changes.
Regarding NFTs, the value being returned includes the Token ID and Serial Number, which is great. However, for NFTs, the path should ideally be something like
/data/tokenId/serialNumber
instead of/data/nft/5
, as I don't know what the5
refers to.I didn't test other operations, but I guess we will have these problems in many different operations.
Example of a subscription:
Query
patchedSubscription
The text was updated successfully, but these errors were encountered: