This renames the OpportunityQuestion concept to PreScreenQuestion and makes it polymorphic (questionable_id / questionable_type) so pre-screen questions can be attached to any entity, not just Opportunity. It also replaces the self-referential parent_id/sub_questions hierarchy with a polymorphic options association, and adds :date as a documented question_type option.
Backing migration: db/migrate/20260904134529_migrate_opportunity_questions_to_pre_screen_questions.rb — renames the table to pre_screen_questions, replaces opportunity_id + parent_id with a polymorphic questionable reference (non-null), and backfills existing rows (parent_id rows become PreScreenQuestion options; opportunity_id rows become Opportunity questions).
Types::Objects::OpportunityQuestionThe entire object type was deleted and replaced by Types::Objects::PreScreenQuestion.
Removed field | Notes |
|---|---|
| Replaced by the polymorphic |
| Renamed/replaced by |
Types::Objects::PreScreenQuestionclass Types::Objects::PreScreenQuestion < Types::BaseObject
field :id, ID, null: true
field :is_mandatory, Boolean, null: true
field :position, Integer, null: true
field :question_text, String, null: true
field :question_type, String, null: true
field :options, [Types::Objects::PreScreenQuestion], null: true
end
Why it was created: to generalize screening questions so any record (e.g. Opportunity, or another PreScreenQuestion for options/sub-questions) can own them via questionable.
Types::Objects::Opportunity — field changesChange | Old | New |
|---|---|---|
Renamed |
|
|
Renamed + retyped |
|
|
Inputs::OpportunityQuestion → renamed to Inputs::PreScreenQuestionChange | Detail |
|---|---|
Removed argument |
|
Added argument |
|
Added argument |
|
Updated argument |
|
Unchanged |
|
Query | Reason |
|---|---|
| Was already deprecated ( |
| removed. use |
Mutation | Replaced by |
|---|---|
|
|
|
|
|
|
|
|
add_pre_screen_question(pre_screen_question: PreScreenQuestionInput) → PreScreenQuestionCreates a PreScreenQuestion attached polymorphically to the record identified by questionable_id / questionable_type. The old opportunity_id argument is gone — pass questionableType: "Opportunity" with questionableId to attach to an opportunity, or questionableType: "PreScreenQuestion" to create an option/sub-question.
Why: supports attaching questions to any entity type, not only opportunities.
mutation {
addPreScreenQuestion(
preScreenQuestion: {
questionableId: "123"
questionableType: "Opportunity"
questionText: "Why do you want to apply?"
questionType: "paragraph"
position: 1
isMandatory: true
}
) {
id
questionText
questionType
position
isMandatory
}
}update_pre_screen_question(id: ID!, pre_screen_question: PreScreenQuestionInput) → PreScreenQuestionFinds the question by id and updates it with the provided attributes. Same behavior as before, renamed.
mutation {
updatePreScreenQuestion(
id: "456"
preScreenQuestion: {
questionableId: "123"
questionableType: "Opportunity"
questionText: "Updated question text"
questionType: "multiple_choice"
position: 2
isMandatory: false
}
) {
id
questionText
}
}remove_pre_screen_question(id: ID!) → PreScreenQuestionFinds the question by id and destroys it.
mutation {
removePreScreenQuestion(id: "456") {
id
}
}bulk_remove_pre_screen_questions(ids: [ID]) → [PreScreenQuestion]Destroys all PreScreenQuestion records matching the given ids.
mutation {
bulkRemovePreScreenQuestions(ids: ["456", "789"]) {
id
}
}assign_questionnaire(id: ID!, questionnaire_id: ID!) → OpportunityUnchanged signature. Internally it now destroys/creates pre_screen_questions instead of opportunity_questions, and creates questionnaire sub-questions via pre_screen_question.options.create(...) (polymorphic) rather than sub_questions.create(...) via parent_id.
mutation {
assignQuestionnaire(id: "123", questionnaireId: "42") {
id
preScreenQuestions {
id
questionText
options { id questionText }
}
}
}Old name | New name | Kind |
|---|---|---|
|
| Object type |
|
| Input type |
| — removed — | Query field |
| — removed — | Query field |
|
|
|
|
|
|
|
| Question field |
| — removed (polymorphic | Question field |
|
| Input argument |
|
| Mutation |
|
| Mutation |
|
| Mutation |
|
| Mutation |
opportunityQuestion(s) / getOpportunityQuestions / hasOpportunityQuestions / addOpportunityQuestion / updateOpportunityQuestion / removeOpportunityQuestion / bulkRemoveOpportunityQuestions schema names no longer exist — clients must migrate to the preScreenQuestion(s) equivalents.Opportunity.opportunityQuestions was a Relay-style connection; Opportunity.preScreenQuestions is a plain list — pagination arguments (first, after, edges/node, pageInfo) are no longer applicable.PreScreenQuestion.options is a plain list, not a connection (previously subQuestions was a connection).addPreScreenQuestion no longer accepts opportunityId; questionableId and questionableType are now required inside the input.