Cookie banner cookies data schema changes#1079
Merged
Conversation
Signed-off-by: Émile Ré <emile@getprobo.com>
The create, delete, and move cookie mutations were not updating the Relay store connections, so the UI only reflected changes after a page reload. Add @connection and @appendEdge/@deleteEdge directives, and a store updater for the move mutation. Also document mutation store update rules in contrib/claude/relay.md. Signed-off-by: Émile Ré <emile@getprobo.com>
ConnectionHandler.getConnection could not find the cookies connection because orderBy was implicitly treated as a filter. Add filters: [] to the @connection directive and document the filters rule in contrib/claude/relay.md. Signed-off-by: Émile Ré <emile@getprobo.com>
d2586dc to
8dfed9f
Compare
Contributor
There was a problem hiding this comment.
2 issues found across 19 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="contrib/claude/coredata.md">
<violation number="1" location="contrib/claude/coredata.md:132">
P2: Don’t discard the Exec command tag here; UPDATE/DELETE callers need RowsAffected() to preserve ErrResourceNotFound semantics.</violation>
</file>
<file name="contrib/claude/relay.md">
<violation number="1" location="contrib/claude/relay.md:344">
P3: Don't make `__id` mandatory here. Relay can also derive the connection ID with `ConnectionHandler.getConnectionID`, so mutations don't need to select `__id` in every fragment.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Address PR review comments: capture Exec result and check RowsAffected() == 0 to return ErrResourceNotFound in Cookie.Update, CookieCategory.Update, and CookieCategory.UpdateRank. Also update coredata and relay contributor docs accordingly. Signed-off-by: Émile Ré <emile@getprobo.com>
SachaProbo
approved these changes
Apr 21, 2026
| cookie_banner_id TEXT NOT NULL REFERENCES cookie_banners(id) ON DELETE CASCADE, | ||
| cookie_category_id TEXT NOT NULL REFERENCES cookie_categories(id) ON DELETE CASCADE, | ||
| name TEXT NOT NULL, | ||
| duration TEXT NOT NULL, |
Contributor
There was a problem hiding this comment.
We could use interval type ?
Contributor
Author
There was a problem hiding this comment.
It can be "session" when no max age or expires is set. Seems to be just text on other banner systems too
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to ENG-266
Summary by cubic
Moves cookie data to a dedicated
cookiestable and GraphQL model with full CRUD, replacing the embedded array on categories. The console UI now uses Relay connections so creating, editing, deleting, and moving cookies updates lists instantly without reloads. Also fixes update operations to return “not found” when no rows are affected.New Features
cookiestable with unique name per banner; dropscookie_categories.cookies.pkg/coredata/cookie.goandCookieOrderField; service methods to create/get/update/delete/list/count cookies; draft versions update on cookie changes; updates useExecand checkRowsAffected()for not-found.Cookietype andCookieConnectiononCookieCategory.cookies; addscreateCookie,updateCookie,deleteCookie;moveCookieToCategorynow takescookieIdand returns the moved cookie.core:cookie:*).CategorySectionuses Relay@connectionwithfilters: [],@appendEdge/@deleteEdge, and anupdaterfor moves;CookieDialogcallscreateCookie;EditCookieRowreads a fragment; improved duplicate-name error handling.contrib/claude/coredata.md(useExec, checkRowsAffected) andcontrib/claude/relay.md(connectionfilters: [], store updates).Migration
CookieCategory.cookiesis now a connection; queryedges { node { id name duration description } }and__idif you update the list.cookiesfromCreateCookieCategoryInputandUpdateCookieCategoryInput.MoveCookieToCategoryInputnow usescookieIdandtargetCookieCategoryId; payload returnscookieandcookieBanner.createCookie,updateCookie, anddeleteCookiemutations and handle CONFLICT errors for duplicate names.Written for commit 82748f8. Summary will update on new commits.