a8n: Implement CampaignPlan & ChangesetPlan in GraphQL API
Created by: mrnugget
This is part of #6085 (closed) (and RFC 42) and implements the GraphQL resolvers for the CampaignPlan
and ChangesetPlan
entities that were stubbed out until now.
There's nothing really tricky here: it pulls CampaignPlan
s and CampaignJob
s out of the database and wraps them in resolvers so that the all the fields of in the schema work.
It's a massive amount of boilerplate.
Noteworthy is that I could reduce the number of Go interfaces needed by having the ChangesetPlansConnectionResolver
, which is *campaignJobsConnectionResolver
here, implement two GraphQL fields on CampaignPlan
: RepositoryDiffs
and Changesets
. That gets rid of having to have an intermediate PreviewRepositoryDiffsConnectionResolver
and doing that whole dance twice.
TODOs:
-
Change the placerholder title and description (@sqs what should those be? Since the plan is not connected to a Campaign yet and the possibly hasn't entered title/description yet, we can't use that) -
Respect connection args in campaignPlanResolver.Changesets
&campaignPlanResolver.RepositoryDiffs