You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m having an odd problem with two-way relationships.
Scenario, I have two lists (session and competitor ). A competitor relates to one session and a session has many competitors.
When I run my createCompetitors mutation, it ‘connects’ the 50 new competitors to an existing session successfully, but if I query for session.competitior, I only get two records.
There is a lot of code, so I don’t know what makes sense to share here, but happy to answer any questions or show anyone tomorrow. (edited)
To Reproduce
Steps to reproduce the behaviour. Please provide code snippets or a repository:
Create a keystone app with the following schema
exports.Session = {
schemaDoc: "A session during a race weekend",
fields: {
name: { type: Text, schemaDoc: "Name of session" },
competitors: { type: Relationship, ref: "Competitor.session", many: true },
}
};
exports.Competitor = {
schemaDoc: "A car/driver that took part in a session",
fields: {
name: { type: Text, schemaDoc: "Driver(s) name" },
session: { type: Relationship, ref: "Session.competitors" },
}
};
Bug report
Describe the bug
I’m having an odd problem with two-way relationships.
Scenario, I have two lists (session and competitor ). A competitor relates to one session and a session has many competitors.
When I run my createCompetitors mutation, it ‘connects’ the 50 new competitors to an existing session successfully, but if I query for session.competitior, I only get two records.
There is a lot of code, so I don’t know what makes sense to share here, but happy to answer any questions or show anyone tomorrow. (edited)
To Reproduce
Steps to reproduce the behaviour. Please provide code snippets or a repository:
allSessions
query, the session should only have two competitors.Expected behaviour
The session should have all 50 competitors related to it
The text was updated successfully, but these errors were encountered: