Feature Request: Expose 1 to 1 relation by rest of Composite key on object
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, sql
调研方向
从 issue 中的 SQL 模式和当前 GraphQL 查询开始,将返回列表的关系与所请求的单数关系进行比较。调查 PostGraphile 如何公开复合键关系,并确定是否可以无歧义地生成所需字段。当可以使用剩余的键字段直接查询复合键关系并返回相关对象时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I'm submitting a ...
- bug report
- feature request
- question
PostGraphile version: v4.4.0
Given the following SQL
CREATE TABLE languages("id" SMALLINT PRIMARY KEY);
CREATE TABLE foo("id" SMALLINT PRIMARY KEY);
CREATE TABLE foo_names
(
"foo_id" SMALLINT NOT NULL REFERENCES foo(id),
"language_id" SMALLINT NOT NULL REFERENCES languages(id),
"name" VARCHAR (16) NOT NULL UNIQUE,
PRIMARY KEY(foo_id, language_id)
);
I would like to be able to request resources with a composite key referencing the current object by just the other fields in the composite key.
{
# Without `pg-simplify-inflector` renames to show more clearly
allFoos {
nodes {
# Current solution
fooNamesByFooId(condition: { languageId: 1 }) {
# Will always return a list with asingle element since
# (languageId, fooId) is the key for fooNames
nodes {
name
}
}
# What I want to do here:
fooNamesByFooIdAndLanguageId(languageId: 1) {
# Returning the element directly
name
}
}
}
}
I could not find any way to accomplish this currently. Is this something that you would be interested in a PR/plugin for?
- 主要语言
- JavaScript
- 星标
- 764
- 派生
- 128
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
graphile/graphile-engine 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 35/100
graphile/graphile-engine#869 · 1 条评论 · 1 个 reaction ·
-
Provide a type guard to distinguish between ResolveTree and FieldsByTypeName可能重新可做 关联的 PR 已关闭且未合并。 未关闭enhancement
难度 2/5 1-3 小时 新手友好度 45/100
graphile/graphile-engine#849 · 2 条评论 · 1 个 reaction ·
-
🐛 bug help wanted
难度 3/5 1-2 天 新手友好度 35/100
graphile/graphile-engine#818 ·
-
Race condition when closing LDS可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 3/5 1-2 天 新手友好度 32/100
graphile/graphile-engine#755 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 15/100
graphile/graphile-engine#725 · 17 条评论 · 5 个 reaction ·
查看 graphile/graphile-engine 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
directus/directus#28558 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
cloudflare/workers-sdk#17189 ·
维护者通常 1 天内回复
-
AWS Lambda Waiting for: Product Owner
难度 1/5 1 小时以内 新手友好度 82/100
getsentry/sentry-javascript#26910 · 1 条评论 ·
维护者通常 1 天内回复
-
[🐛 Bug]: @wdio/reporter drops the function name of a string script in command output可能已有人在做 @dhananjay6561 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 80/100
webdriverio/webdriverio#16507 · 1 条评论 ·
维护者通常 1 天内回复