Skip to content
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

Make StreamfieldChooser blocks values nullable #396

Merged

Conversation

JakubMastalerz
Copy link
Contributor

resolves #394

This PR changes the "value fields" of SnippetChooserBlock, DocumentChooserBlock, ImageChooserBlock and PageChooserBlock grapple types to be nullable.

This will allow those blocks to handle referencing deleted objects. Users will be able to implement gracious failing where those blocks are used instead of having to handle grapple errors.

Copy link
Contributor

@jams2 jams2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this by inspecting the documentation in GraphiQL running on this branch:

  • PageChooserBlock.page is nullable
  • DocumentChooserBlock.document is nullable
  • SnippetChooserBlock.snippet is nullable
  • ImageChooserBlock.image is nullable

tests/test_models_types.py Outdated Show resolved Hide resolved
@zerolab zerolab merged commit 1b29638 into torchbox:main Jun 20, 2024
16 checks passed
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.

Stream field chooser block values should be nullable
3 participants