docs: FAQ for 400 error when resuming a flow via API#646
Conversation
Closes #322. Explains that resumeContactFlow's `result` argument must be a JSON-encoded string (not a raw object) since Glific's Json scalar only parses string/null literals, with a working example and other things to check for a genuine 400. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis pull request adds a new FAQ documentation page explaining why the GraphQL Changes
Related Issues: None specified. Related PRs: None specified. Suggested labels: documentation Suggested reviewers: None specified. Poem: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
|
🚀 Deployed on https://deploy-preview-646--glific-docs.netlify.app |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/8`. FAQ/Resolving 400 Error When Resuming a Flow via API.md:
- Line 1: The document title is using a level-2 heading instead of a top-level
heading, which triggers markdownlint MD041 and weakens the hierarchy. Update the
first heading in this FAQ page from the current title to an H1 so the document
starts with a single top-level heading and remains consistent with the rest of
the docs structure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3e031cf2-7889-4df4-8e3d-595a366d7644
📒 Files selected for processing (1)
docs/8. FAQ/Resolving 400 Error When Resuming a Flow via API.md
| @@ -0,0 +1,63 @@ | |||
| ## Why do I get a 400 error when resuming a flow via API? | |||
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Promote the page title to an H1.
This file starts with ##, which trips markdownlint MD041 and weakens the document hierarchy. Use a top-level heading instead.
Suggested fix
-## Why do I get a 400 error when resuming a flow via API?
+# Why do I get a 400 error when resuming a flow via API?📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## Why do I get a 400 error when resuming a flow via API? | |
| # Why do I get a 400 error when resuming a flow via API? |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 1-1: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/8`. FAQ/Resolving 400 Error When Resuming a Flow via API.md at line 1,
The document title is using a level-2 heading instead of a top-level heading,
which triggers markdownlint MD041 and weakens the hierarchy. Update the first
heading in this FAQ page from the current title to an H1 so the document starts
with a single top-level heading and remains consistent with the rest of the docs
structure.
Source: Linters/SAST tools
Summary
resumeContactFlow(used to resume a flow paused at a "Wait for Results" node) can return an HTTP 400.glific/glificbackend: theresultargument is typedJson, and Glific's customJsonscalar only parses a JSON-encoded string (seeparse(&decode_json/1)ingeneric_types.ex, which only handlesInput.String/Input.Null). Passing a raw JSON object fails GraphQL validation and Absinthe returns a 400, distinct from application-level errors which come back as 200 with anerrorsarray.Closes #322
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit