Inconsistent plugins development documentation
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 20/100
- Issue-Typ
- Dokumentation
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- javascript
- Bereich
- documentation
Rechercherichtung
Beginnen Sie mit den verlinkten Abschnitten „Enabling via postgraphilerc.js“ und „Writing your own plugins“, und reproduzieren Sie dann den gemeldeten Objekt-vs.-Funktionsfehler anhand des gezeigten CorsPlugin-Beispiels. Erledigt ist die Aufgabe, wenn die Plugin-Dokumentation Plugin- und Hook-Typen, ihre Parameter und Beziehungen erklärt und klare Beispiele für Bibliothek, RC-Datei und CLI bereitstellt, einschließlich des vorhandenen CORS-Plugins.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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... :(
- Vorherrschende Sprache
- SCSS
- Sterne
- 27
- Forks
- 124
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus graphile/graphile.github.io
-
help wanted quick
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 38/100
graphile/graphile.github.io#401 · 1 Kommentar · 1 Reaktion ·
-
website: Update details on homepage and sponsor pageEvtl. wieder frei @jemgillam hat das vor 1119 Tagen übernommen, und es ist kein Pull Request offen. Offenquick
graphile/graphile.github.io#399 · 4 Kommentare · 1 zugewiesene Person ·
-
sponsor page: New wording around Grafast needed!Evtl. wieder frei @jemgillam hat das vor 1149 Tagen übernommen, und es ist kein Pull Request offen. Offen
graphile/graphile.github.io#393 · 1 Reaktion · 1 zugewiesene Person ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 38/100
graphile/graphile.github.io#341 · 1 Reaktion ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 25/100
graphile/graphile.github.io#280 · 2 Kommentare · 5 Reaktionen ·
Alle Issues in graphile/graphile.github.io
Ähnliche Issues
-
agent/scanner bug stage/010-actionable
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
torch-spyre/spyre-inference#1812 ·
Maintainer antworten meist innerhalb von 1 Tag
-
sync-en
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
[oblt-aw][autodoc] Update autodoc routing docs for relative in-repo lock usesEvtl. vergeben @github-actions hat das heute übernommen. Offen
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 87/100
Maintainer antworten meist innerhalb von 1 Tag
-
[Enhancement] platform-engineer: a definition change does not re-render running Applications; say how to roll it outEvtl. vergeben @anoop2811 hat das heute übernommen. Offenneeds-triage type/enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
cloudflare/workers-sdk#17189 ·
Maintainer antworten meist innerhalb von 1 Tag