Skip to content

Generic form system: GraphQL query side (PR 2/5) - #4707

Open
marcoacierno wants to merge 4 commits into
generic-forms/01-appfrom
generic-forms/02-graphql-query
Open

Generic form system: GraphQL query side (PR 2/5)#4707
marcoacierno wants to merge 4 commits into
generic-forms/01-appfrom
generic-forms/02-graphql-query

Conversation

@marcoacierno

Copy link
Copy Markdown
Member

Summary

Second PR of the generic form system stack (stacked on #4705 — review that first). Read-only GraphQL surface for conference forms:

  • conference.form(purpose: FormPurpose)Form | null, mirroring the existing deadline(type) pattern
  • Form { id, name, questions } with questions active-only, ordered by order
  • FormQuestion { id, label, description, questionType, required, maxLength, options { id, label } }
  • Enums exposed as FormPurpose / FormQuestionType (explicit names to keep the schema namespace clean)

Additive schema change only — no mutations, no existing types touched beyond the new Conference.form field.

Test plan

  • 7 API tests (api/generic_forms/tests/): null when unconfigured / wrong purpose / other conference; full field shape; options exposure; ordering; inactive questions hidden
  • Full suite green (1197 passed); ruff + format clean

Stack: PR1 #4705PR2 (this) → PR3 grants backend → PR4 admin display/export → PR5 frontend.

conference.form(purpose) returns the form configured for the given
purpose (null when unconfigured) with its active questions in order:
label, description, type, required, maxLength and select options.
Query-side only; submitting answers lands with the grants integration.
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pycon Ready Ready Preview Aug 7, 2026 2:42am

@claude

claude Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary: Adds a read-only conference.form(purpose) GraphQL query exposing generic forms and their active, ordered questions (with select options), stacked on PR #4705's models.

No significant issues found. One thing worth confirming with the author:

  • backend/api/conferences/types.py: self.forms.filter(purpose=purpose).first() assumes a single form per (conference, purpose). That's enforced by the model's unique constraint for every purpose except generic (generic_forms/models.py Meta.constraints), which explicitly allows multiple generic forms per conference. For purpose=GENERIC this silently returns only the oldest form (lowest pk) and drops the rest with no way for a client to know more exist. If multiple generic forms per conference is an intentional, supported case, the query-side API should account for it (e.g. return a list, or document that only one is queryable via this field).

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.47%. Comparing base (d2b4b60) to head (321f30f).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           generic-forms/01-app    #4707      +/-   ##
========================================================
+ Coverage                 92.45%   92.47%   +0.02%     
========================================================
  Files                       358      359       +1     
  Lines                     10888    10921      +33     
  Branches                    852      852              
========================================================
+ Hits                      10066    10099      +33     
  Misses                      706      706              
  Partials                    116      116              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant