Skip to content

Aliases

Samiwel Thomas edited this page Sep 6, 2018 · 2 revisions

Introduction

This wiki page captures current design thinking about how aliasing will be implemented within Author.

Background

Aliases are user-specified shorthand codes that are used to identify entities within a questionnaire. For example a question with a title of "Please confirm that your date of birth is 01/01/1970" may have an alias of confirm-dob.

Often aliases are established numeric codes that identify a question.

GraphQL schema

The initial implementation of aliases will only be applied to Sections and QuestionPages. A new field will be added to these types in the GraphQL schema. e.g.

Section {
  id: ID!
  title: String
  alias: String
}

QuestionPage {
  id: ID!
  title: String
  alias: String
}

The alias field should return a plaintext string value (without any markup). The fields are nullable and will return null if empty.

Mutation input types will also need to be updated to support updating alias values.

Database changes

A new column will be added to the Sections and Pages tables called alias The new column will contain a VARCHAR and default to null.

Assumptions

The maximum character length is suggested to be 24 characters for aliases. In practice we would allow the user to enter longer values but truncate when displaying the aliases.

Clone this wiki locally