We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a Pattern Entry defined as such:
Entry
export const Entry: Pattern = { name: 'Entry', fields: { competitionID: UUIDType({ fieldEdge: { schema: 'Competition', inverseEdge: { name: 'entries', hideFromGraphQL: true, }, }, index: true, }), // More fields }, edges: [ { name: 'horsesInEntry', schemaName: 'Horse', inverseEdge: { name: 'competitionEntries' }, }, ], };
The resulting codegen correctly creates a query method on the base mixin:
export interface IEntryBase<TViewer extends Viewer = Viewer> extends Ent<TViewer> { competitionId: ID; queryHorsesInEntry(): ObjectToHorsesInEntryQuery; }
However, the queryEntries() method on the Competition ent is defined as such:
queryEntries()
Competition
queryEntries(): CompetitionToEntriesQuery { return CompetitionToEntriesQuery.query(this.viewer, this.id); }
export abstract class CompetitionToEntriesQueryBase extends AssocEdgeQueryBase< Competition, Ent<BarnlogViewer>, CompetitionToEntriesEdge, BarnlogViewer > { constructor( viewer: BarnlogViewer, src: EdgeQuerySource<Competition, Ent<BarnlogViewer>, BarnlogViewer>, ) { super( viewer, src, competitionToEntriesCountLoaderFactory, competitionToEntriesDataLoaderFactory, (str) => getLoaderOptions(str as NodeType), ); } static query<T extends CompetitionToEntriesQueryBase>( this: new ( viewer: BarnlogViewer, src: EdgeQuerySource<Competition, Ent<BarnlogViewer>>, ) => T, viewer: BarnlogViewer, src: EdgeQuerySource<Competition, Ent<BarnlogViewer>>, ): T { return new this(viewer, src); } sourceEnt(id: ID) { return Competition.load(this.viewer, id); } }
The two main errors are that the AssocEdgeQueryBase generics should be defined like this:
AssocEdgeQueryBase
export abstract class CompetitionToEntriesQueryBase extends AssocEdgeQueryBase< Competition, - Ent<BarnlogViewer>, + IEntry<BarnlogViewer>, CompetitionToEntriesEdge, BarnlogViewer > {
And the other is that it is missing the queryHorsesInEntry() method so that I can chain query methods:
queryHorsesInEntry()
const horses = await competition.queryEntries().queryHorsesInEntry().queryEnts();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have a Pattern
Entry
defined as such:The resulting codegen correctly creates a query method on the base mixin:
However, the
queryEntries()
method on theCompetition
ent is defined as such:The two main errors are that the
AssocEdgeQueryBase
generics should be defined like this:And the other is that it is missing the
queryHorsesInEntry()
method so that I can chain query methods:The text was updated successfully, but these errors were encountered: