Skip to content

Commit

Permalink
Feat: sponsored banners (#186)
Browse files Browse the repository at this point in the history
#### What is the purpose of this pull request?

This PR creates and exports the sponsoredBanners query.

#### What problem is this solving?

We need to create Sponsored Banners for our clients. To do this, it's
necessary to request the banners data to Ad Server.
The store-resources create the query and exports it for Sponsored
Banners component.

#### Types of changes

* [ ] Bug fix (a non-breaking change which fixes an issue)
* [x] New feature (a non-breaking change which adds functionality)
* [ ] Breaking change (fix or feature that would cause existing
functionality to change)
* [ ] Requires change to documentation, which has been updated
accordingly.
  • Loading branch information
luarakerlen authored Nov 1, 2024
1 parent 35889b7 commit 4d1a32f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- `sponsoredBanners` query.

## [0.101.0] - 2024-10-30

### Added
Expand Down
3 changes: 2 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"vtex.search-graphql": "0.x",
"vtex.pwa-graphql": "1.x",
"vtex.pixel-manager": "1.x",
"vtex.recommendation-graphql": "0.x"
"vtex.recommendation-graphql": "0.x",
"vtex.adserver-graphql": "0.x"
},
"$schema": "https://raw.githubusercontent.com/vtex/node-vtex-api/master/gen/manifest.schema"
}
3 changes: 3 additions & 0 deletions react/QuerySponsoredBanners.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import QuerySponsoredBanners from './queries/sponsoredBanners.gql'

export default QuerySponsoredBanners
24 changes: 24 additions & 0 deletions react/queries/sponsoredBanners.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
query sponsoredBanners(
$sponsoredCount: Int
$placement: Placement
$adUnit: AdUnit
$channel: Channel
$anonymousId: String
) {
sponsoredBanners(
sponsoredCount: $sponsoredCount
placement: $placement
adUnit: $adUnit
channel: $channel
anonymousId: $anonymousId
) @context(provider: "vtex.adserver-graphql") {
adResponseId
advertisement {
bannerImageId
imageUrl
targetUrl
width
height
}
}
}

0 comments on commit 4d1a32f

Please sign in to comment.