Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 13, 2025

Summary

Implements multi-layer insert functionality for GraphQL mutations, allowing nested object creation as requested in issue #10.

Changes Made

  • Fixed LinksObjRelInsert.data field: Changed from recursive LinksObjRelInsert to LinksInsert type to properly support nested object structure
  • Enhanced LinksMutation.InsertLink method: Added recursive logic to handle nested from and to objects
  • Added .editorconfig file: Created missing configuration file to resolve build issues

Features

Now supports GraphQL mutations with nested object creation:

mutation InsertTriplet {
  insert_links_one(object: { from: { from_id: 1, to_id: 2 }, to_id: 3}) {
    returning {
      id
    }
  }
}

Implementation Details

  • When from or to objects are provided with data field, the system first creates those nested links recursively
  • The IDs of the created nested links are then used as from_id and to_id for the parent link
  • Falls back to direct from_id/to_id values when nested objects are not provided
  • Maintains backward compatibility with existing mutation patterns

Test Results

  • ✅ Project builds successfully with only expected nullable reference warnings
  • ✅ Backward compatibility maintained
  • ✅ Recursive nested object creation supported

Fixes #10

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #10
@konard konard self-assigned this Sep 13, 2025
- Fix LinksObjRelInsert.data field to point to LinksInsert instead of recursive LinksObjRelInsert
- Update LinksMutation.InsertLink method to handle nested from/to objects
- Add recursive logic to create nested links first, then use their IDs for parent link creation
- Create .editorconfig file to fix build issues
- Enable GraphQL mutations like: { from: { from_id: 1, to_id: 2 }, to_id: 3}

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Multi-layer insert Implement multi-layer insert for GraphQL mutations Sep 13, 2025
@konard konard marked this pull request as ready for review September 13, 2025 04:32
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-layer insert

2 participants