-
Notifications
You must be signed in to change notification settings - Fork 35
Loosen requirements for Upsert mutations (for templates) #7455
New issue
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
Conversation
WalkthroughThis pull request modifies the GraphQL upsert input generation to remove required field constraints, allowing required relationships and attributes to be omitted when they can be supplied by templates. The changes remove conditional required logic from both attribute and relationship field creation in the upsert input builder. Test coverage is added with a new test case validating upsert behavior with template-supplied relationships. A changelog entry documents this as a fix to enable upsert mutations when using templates that provide required fields. Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used📓 Path-based instructions (4)**/*.{md,mdx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
backend/tests/**/*📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
backend/**/*📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.py📄 CodeRabbit inference engine (.github/instructions/python-docstring.instructions.md)
Files:
🧬 Code graph analysis (2)backend/infrahub/graphql/manager.py (2)
backend/tests/unit/graphql/test_mutation_upsert.py (3)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CodSpeed Performance ReportMerging #7455 will not alter performanceComparing Summary
|
e7dce27 to
1206927
Compare
Mutations to create nodes no longer have required attributes or relationships, the reason is that we want to be able to use Templates that populate this information using the template itself. The Upsert mutations still have these requirements in place and as such it's not possible to create an object using an Upsert mutation that requires a template to fill in the missing information. This PR removes the requirements for attributes and relationships from the Upsert mutation.
Fixes #7398
Summary by CodeRabbit
Bug Fixes
Tests