Inconsistent plugins development documentation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
- Tipo di issue
- Documentazione
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- documentation
Direzione di ricerca
Inizia con le sezioni collegate “Enabling via postgraphilerc.js” e “Writing your own plugins”, quindi riproduci l’errore segnalato oggetto-invece-di-funzione usando l’esempio CorsPlugin mostrato. Il lavoro è completato quando la documentazione dei plugin spiega i tipi di plugin e hook, i relativi parametri e le relazioni tra loro, e fornisce esempi chiari per la libreria, il file rc e la CLI, incluso il plugin CORS esistente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I'm trying to add a custom plugin to the postgraphile:http:handler event.
Accordint to the https://www.graphile.org/postgraphile/plugins/#enabling-via-postgraphilercjs section, I'm adding it to the plugins rc file section.
According to the https://www.graphile.org/postgraphile/plugins/#writing-your-own-plugins section, I've created my plugin stub:
const CorsPlugin = {
['postgraphile:http:handler'] (req, p2) {
console.log(req);
console.log(p2);
return req;
}
}
module.exports = CorsPlugin
But when running, I'm getting the following error log:
/postgraphile/build-turbo/postgraphile/cli.js:300
throw new Error(`No plugin found matching spec '${name}' - expected function, found '${typeof plugin}'`);
^
Error: No plugin found matching spec '/postgraphile/CorsPlugin' - expected function, found 'object' at /postgraphile/build-turbo/postgraphile/cli.js:300:19
Please update these docs on how to write own plugins.
Also, there's no documentation on how to use the existing CORS plugin example with the rc file to be able to adapt it to my needs. Plugins documentation is overall messy and it's hard to understand what's going on and how to catch anything without a long time googling, discord discussions, or github issues.
My main pain points during all my Postgraphile experience are:
- What type of plugins exists?
- What's the difference between plugin types?
- How plugins and hooks relate?
- What types of hooks exist?
- Which hooks can be set up from which plugins?
- Where to see plugins and hooks parameters documentation?
- How to convert plugins and hooks declaration/connection between different types (middleware, library, rc file, CLI)? If I found an example of a plugin/hook I spend a lot of time trying to adapt it to rc file.
- When I see a comment like
use postgraphile:http:handler to intercept the result if it's for usused by Benjie everywhere I see a wall of hours of investigations how to implement it in the reality. Especially in my deployment way (with an rc file). - A single entrypoint of plugins/hooks documentation with a clear table of contents would be very useful. Like this: https://www.easypost.com/docs/api . Examples of plugins with the different types of connection (library/rc file/cli) like code examples in different languages also would be super useful (here https://www.easypost.com/docs/api it is implemented as a dropdown list, some sites use tabs: https://cloud.google.com/tasks/docs/reference/rest/v2/projects.locations.queues.tasks/run).
I like Postgraphile a lot, but every time I need to do something by my own plugins I feel pain... :(
- Lingua principale
- SCSS
- Stelle
- 27
- Fork
- 124
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
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 graphile/graphile.github.io
-
help wanted quick
Difficoltà 2/5 1-3 ore Idoneità per principianti 38/100
graphile/graphile.github.io#401 · 1 commento · 1 reazione ·
-
website: Update details on homepage and sponsor pageForse di nuovo libera @jemgillam l’ha presa 1119 giorni fa e non c’è nessuna pull request aperta. Apertaquick
graphile/graphile.github.io#399 · 4 commenti · 1 assegnatario ·
-
sponsor page: New wording around Grafast needed!Forse di nuovo libera @jemgillam l’ha presa 1149 giorni fa e non c’è nessuna pull request aperta. Aperta
graphile/graphile.github.io#393 · 1 reazione · 1 assegnatario ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 38/100
graphile/graphile.github.io#341 · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
graphile/graphile.github.io#280 · 2 commenti · 5 reazioni ·
Tutte le issue di graphile/graphile.github.io
Issue simili
-
marketing
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
gke-labs/kube-agents#7308 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 62/100
-
chore
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
lugassawan/swe-workbench#841 ·