-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat(form): multiple files in file questions #1809
Merged
Merged
Conversation
This file contains 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
winged
force-pushed
the
feat_multi_file_question
branch
from
July 4, 2022 07:23
acab7b1
to
0abb110
Compare
The original Graphene API allows adding an `Input` (or, without Relay, a `Arguments`) class to be added on mutation classes. Caluma derives it's inputs solely from the attached serializer. This fails if the required data type is more complex than what can be represented on the serializer, whose most complex type is a list of strings. However, we need a list of well-defined objects, so we check on the mutation class to see if a more specific field type is declared, and use that one in the schema.
The reopen case mutation had a "required" ID in the schema, but when regenerating, the requiredness was removed. Thus, adding an explicit `required=True` to keep the semantics as has been. Implicitly, the schema takes on the docstring of the `workItems` parameter as well
winged
force-pushed
the
feat_multi_file_question
branch
3 times, most recently
from
July 4, 2022 08:27
3882d1c
to
4552538
Compare
winged
force-pushed
the
feat_multi_file_question
branch
8 times, most recently
from
July 4, 2022 12:48
99e6a2e
to
48400b6
Compare
fugal-dy
approved these changes
Jul 4, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as far as I can tell. relly just nitpickery
winged
force-pushed
the
feat_multi_file_question
branch
3 times, most recently
from
July 4, 2022 17:14
88e51e8
to
0ab8917
Compare
Change the model to allow multiple files per answer to be stored. Migrate the existing questions to the new question type, and migrate the existing answers to the new schema. Updated the GraphQL schema to allow saving and updating multiple files on an answer. The answer's value is a list of dicts, each containing a file name, and optionally an ID. When you're creating new files, add an entry without ID to the value. Caluma will then save the file, and return it back WITH and ID. BREAKING CHANGE: This renames the question type constant for file questions, and changes the semantics of the answer value for file questions as well: It is now a list of dicts instead of a single string. The response type for querying file(s) answers now also is a list instead of a single dict.
winged
force-pushed
the
feat_multi_file_question
branch
from
July 5, 2022 08:38
0ab8917
to
89ce59b
Compare
Merging, as @open-dynaMIX approved off-github |
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.
Change the model to allow multiple files per answer to be stored. Migrate
the existing questions to the new question type, and migrate the existing
answers to the new schema.
Updated the GraphQL schema to allow saving and updating multiple files
on an answer. The answer's value is a list of dicts, each containing
a file name, and optionally an ID. When you're creating new files,
add an entry without ID to the value. Caluma will then save the file,
and return it back WITH and ID.
BREAKING CHANGE: This renames the question type constant for file questions,
and changes the semantics of the answer value for file questions as well:
It is now a list of dicts instead of a single string. The response type
for querying file(s) answers now also is a list instead of a single dict.
For details / RFC see #1780