Inconsistent plugins development documentation
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 20/100
- Issue 类型
- 文档
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
先阅读链接的“Enabling via postgraphilerc.js”和“Writing your own plugins”部分,然后使用所示的 CorsPlugin 示例重现报告的对象与函数错误。完成的标准是:插件文档解释插件和 hook 的类型、它们的参数及相互关系,并提供清晰的库、rc 文件和 CLI 示例,其中包括现有的 CORS 插件。
由索引模型根据 Issue 内容生成。
描述
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... :(
- 主要语言
- SCSS
- 星标
- 27
- 派生
- 124
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
graphile/graphile.github.io 的其他 Issue
-
help wanted quick
难度 2/5 1-3 小时 新手友好度 38/100
graphile/graphile.github.io#401 · 1 条评论 · 1 个 reaction ·
-
website: Update details on homepage and sponsor page可能重新可做 @jemgillam 于 1119 天前认领,目前没有进行中的 PR。 未关闭quick
graphile/graphile.github.io#399 · 4 条评论 · 已指派 1 人 ·
-
sponsor page: New wording around Grafast needed!可能重新可做 @jemgillam 于 1149 天前认领,目前没有进行中的 PR。 未关闭
graphile/graphile.github.io#393 · 1 个 reaction · 已指派 1 人 ·
-
难度 2/5 1-3 小时 新手友好度 38/100
graphile/graphile.github.io#341 · 1 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 25/100
graphile/graphile.github.io#280 · 2 条评论 · 5 个 reaction ·
查看 graphile/graphile.github.io 的全部 Issue
相似的 Issue
-
marketing
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 74/100
gke-labs/kube-agents#7308 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 62/100
-
chore
难度 1/5 1-3 小时 新手友好度 88/100
lugassawan/swe-workbench#841 ·