Inconsistent plugins development documentation
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 20/100
- Type d'issue
- Documentation
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- javascript
- Domaine
- documentation
Piste de recherche
Commencez par les sections liées « Enabling via postgraphilerc.js » et « Writing your own plugins », puis reproduisez l’erreur signalée d’objet au lieu de fonction à l’aide de l’exemple CorsPlugin montré. Le travail est terminé lorsque la documentation des plugins explique les types de plugins et de hooks, leurs paramètres et leurs relations, et fournit des exemples clairs pour la bibliothèque, le fichier rc et la CLI, y compris le plugin CORS existant.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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... :(
- Langage dominant
- SCSS
- Étoiles
- 27
- Forks
- 124
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Aucun guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de graphile/graphile.github.io
-
help wanted quick
Difficulté 2/5 1-3 heures Accessibilité débutants 38/100
graphile/graphile.github.io#401 · 1 commentaire · 1 réaction ·
-
website: Update details on homepage and sponsor pagePeut-être à nouveau libre @jemgillam l’a pris il y a 1119 jours, et aucune pull request n’est ouverte. Ouvertequick
graphile/graphile.github.io#399 · 4 commentaires · 1 personne assignée ·
-
sponsor page: New wording around Grafast needed!Peut-être à nouveau libre @jemgillam l’a pris il y a 1149 jours, et aucune pull request n’est ouverte. Ouverte
graphile/graphile.github.io#393 · 1 réaction · 1 personne assignée ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 38/100
graphile/graphile.github.io#341 · 1 réaction ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 25/100
graphile/graphile.github.io#280 · 2 commentaires · 5 réactions ·
Toutes les issues de graphile/graphile.github.io
Issues similaires
-
agent/scanner bug stage/010-actionable
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
torch-spyre/spyre-inference#1812 ·
Les mainteneurs répondent en général sous 1 jour
-
sync-en
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
[oblt-aw][autodoc] Update autodoc routing docs for relative in-repo lock usesPeut-être pris @github-actions l’a pris aujourd’hui. Ouverte
Difficulté 1/5 1-3 heures Accessibilité débutants 87/100
Les mainteneurs répondent en général sous 1 jour
-
[Enhancement] platform-engineer: a definition change does not re-render running Applications; say how to roll it outPeut-être pris @anoop2811 l’a pris aujourd’hui. Ouverteneeds-triage type/enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
cloudflare/workers-sdk#17189 ·
Les mainteneurs répondent en général sous 1 jour