Inconsistent plugins development documentation
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 20/100
- Tipo de issue
- Documentação
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- javascript
- Domínio
- documentation
Direção de pesquisa
Comece pelas seções vinculadas “Enabling via postgraphilerc.js” e “Writing your own plugins” e, em seguida, reproduza o erro relatado de objeto em vez de função usando o exemplo CorsPlugin mostrado. O trabalho estará concluído quando a documentação de plugins explicar os tipos de plugins e hooks, seus parâmetros e relacionamentos, e fornecer exemplos claros de biblioteca, arquivo rc e CLI, incluindo o plugin CORS existente.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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... :(
- Linguagem predominante
- SCSS
- Estrelas
- 27
- Forks
- 124
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de graphile/graphile.github.io
-
help wanted quick
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 38/100
graphile/graphile.github.io#401 · 1 comentário · 1 reação ·
-
website: Update details on homepage and sponsor pageTalvez livre de novo @jemgillam assumiu há 1119 dias e não há nenhum pull request aberto. Abertaquick
graphile/graphile.github.io#399 · 4 comentários · 1 responsável ·
-
sponsor page: New wording around Grafast needed!Talvez livre de novo @jemgillam assumiu há 1149 dias e não há nenhum pull request aberto. Aberta
graphile/graphile.github.io#393 · 1 reação · 1 responsável ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 38/100
graphile/graphile.github.io#341 · 1 reação ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 25/100
graphile/graphile.github.io#280 · 2 comentários · 5 reações ·
Todas as issues de graphile/graphile.github.io
Issues semelhantes
-
agent/scanner bug stage/010-actionable
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
torch-spyre/spyre-inference#1812 ·
Mantenedores costumam responder em até 1 dia
-
sync-en
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
[oblt-aw][autodoc] Update autodoc routing docs for relative in-repo lock usesTalvez já em andamento @github-actions assumiu hoje. Aberta
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 87/100
Mantenedores costumam responder em até 1 dia
-
[Enhancement] platform-engineer: a definition change does not re-render running Applications; say how to roll it outTalvez já em andamento @anoop2811 assumiu hoje. Abertaneeds-triage type/enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
cloudflare/workers-sdk#17189 ·
Mantenedores costumam responder em até 1 dia