newjersey / dhs-oneapp

3 stars 2 forks source link

[FE/BE] Define how the form-builder maps to the GraphQL application query #439

Open ronaldheft-gov opened 3 years ago

ronaldheft-gov commented 3 years ago

We have at least two approach to doing this:

Option 1: Map within form-builder

Map the structure into the form builder, so define something application.contact.FIRST_NAME as a mapped value in the form-builder definition. The front-end code will parse the mapped values into the query structure needed to fetch / upsert the application via the GraphQL api.

Option 2: Externally map the form to the query

If the ids are stable within the form-builder, we could externally map the field to the application type with a JSON mapping structure like this:

application: {
  contact: {
    FIRST_NAME: ‘4534fs98u34ur` # <- This is the form-build field id
  }
}
ronaldheft-gov commented 3 years ago

@mikepif Thoughts on an approach you would like to take?