chore: update create campaign api#1724
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Ads Manager “create campaign” flow to align with the new GraphQL API (adsManagerCreateCampaign), including updated input-shaping and regenerated GraphQL client artifacts.
Changes:
- Switch campaign creation mutation from
createCampaigntoadsManagerCreateCampaignand update completion handling. - Update
transformNewFormto produceAdsManagerCreateCampaignInput(new shape for ad sets, geo targets, conversion, creatives). - Refresh GraphQL documents/client + schema snapshot, and adjust the repo’s
graphqldependency version.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/user/views/adsManager/views/advanced/components/form/NewCampaign.tsx | Uses AdsManagerCreateCampaignDocument and reads data.adsManagerCreateCampaign on completion. |
| src/user/library/index.ts | Updates transformNewForm to the new AdsManagerCreateCampaignInput payload structure. |
| src/user/library/index.test.ts | Updates snapshot expectations for the new create-campaign input shape. |
| src/graphql/campaign.graphql | Renames the mutation to AdsManagerCreateCampaign and adds limit/offset args for adSets. |
| src/graphql/ads-serve.graphql.schema.json | Updates schema snapshot to include new fields/types and the new mutation. |
| src/graphql-client/graphql.ts | Regenerated GraphQL TS types and documents (new mutation/input types). |
| src/graphql-client/gql.ts | Regenerated persisted-document mapping for updated operations/fragments. |
| package.json | Changes graphql dependency version. |
| pnpm-lock.yaml | Lockfile updates to reflect the graphql version change and associated dependency graph. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
[puLL-Merge] - brave/ads-ui@1724 DescriptionMigrates campaign creation from Possible Issues
ChangesChanges
sequenceDiagram
participant User
participant NewCampaign
participant transformNewForm
participant Apollo
participant Server
User->>NewCampaign: submit form
NewCampaign->>transformNewForm: CampaignForm
transformNewForm-->>NewCampaign: AdsManagerCreateCampaignInput
NewCampaign->>Apollo: mutation AdsManagerCreateCampaign(input)
Apollo->>Server: adsManagerCreateCampaign
Server-->>Apollo: { id, paymentType }
Apollo-->>NewCampaign: data.adsManagerCreateCampaign
alt paymentType RADOM/complete
NewCampaign->>User: redirect /complete/new
else
NewCampaign->>NewCampaign: createPaymentSession(id)
end
|
Updates the functionality according to new api for creating camapigns.