Graphene acts as Data Cache layer like open query engine.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- graphql, python
- Ambito
- backend-api-design
Direzione di ricerca
La issue non identifica inizialmente alcun file del repository, test o punto di ingresso. Occorre innanzitutto chiarire l’ambito della cache, la generazione delle chiavi, la scadenza, l’invalidazione dovuta alle mutazioni e il comportamento di aggiornamento tra elementi padre e figlio; per completare il lavoro sarebbero necessari un design concordato, la relativa implementazione e i test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi Team,
My name is Giang, I would like to propose a new feature for caching results on certain selected nodes with class Meta: cache = True.
I would to do data analytics on big data lake s3 using pyspark mapping spark (or other libraries) schema to graphene schema and I would like to utilize server side graphql as cache layer . In other words, I would like to treat graphql as a next custom ORM for pyspark or other dataframe libraries.
When query data, I would like to get custom field results on that node and cache it for 30 minutes (Where big data speed of access to data lake s3 does not matter, but rather than the aggregations of results)
@jkimbo cc

Cached data will need to be run when there is no cached data when query and updating when using mutation on the Node

And we also have a scheme for updating from childs to parents
import graphene
Import os
os.env[“GRAPHENE_CACHE_TIME”] = 1800
class Company(graphene.ObjectType):
class Meta:
interfaces = (relay.Node,)
cache = True
name = graphene.String()
revenue = graphene.Float()
datetime = graphene.DateTime()
if there are nested child (update all parent nodes cache)
@classmethod // cache this result on query
get_all_companies(cls, info):
return [cls(**data) for data in database.values()]
@classmethod // cache this result by different pairs of inputs on query
get_company_report_by_period(cls, info, name, period):
selected_data = [data for data in database.values() if name == data[“name”] and period in data[“datetime”]]
return {
“name”: name,
“revenue”: sum(data[“revenue”] for data in selected_data),
“datetime”: period
}
class Query(graphene.ObjectType):
get_report = graphene.List(Company)
get_company_report_period = graphene.Field(Company)
def resolve_get_report(_, info):
return Company.get_all_companies()
def resolve_get_company_report_period(_, info, name, period):
return Company.get_company_report_by_period(name, period)
database = {
“0”: {
“name”: “amazon”,
“revenue”: 1000,
“datetime”: “2021-04-01”
},
“1”: {
“name”: “amazon”,
“revenue”: 1000,
“datetime”: “2021-05-01”
},
“2”: {
“name”: “google”,
“revenue”: 1000,
“datetime”: “2021-06-01”
}
}
Kind regards
Giang
- Lingua principale
- Python
- Stelle
- 8.2k
- Fork
- 818
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di graphql-python/graphene
-
Tutorial mistakes Aperta🐛 bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
graphql-python/graphene#1389 · 5 commenti · 2 reazioni ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
graphql-python/graphene#1606 ·
-
Python 3.14 support Aperta✨ enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 38/100
graphql-python/graphene#1601 · 2 commenti ·
-
✨ enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
graphql-python/graphene#1600 ·
-
🐛 bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
graphql-python/graphene#1593 ·
Tutte le issue di graphql-python/graphene
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·