Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support FE/BE type alignment #81

Open
stephenh opened this issue Mar 13, 2023 · 0 comments
Open

Support FE/BE type alignment #81

stephenh opened this issue Mar 13, 2023 · 0 comments

Comments

@stephenh
Copy link
Contributor

stephenh commented Mar 13, 2023

Given a GraphQL query like:

query {
  projectItem(id: 1) {
    bidItem { id name }
  }
}

And an input query like:

mutation {
  saveProjectItem(input: SaveProjectItemInput)
}

input SaveProjectItemInput {
  bidItem: EntityId
}

input EntityId { id: String! }

We'd like to bind that to a form like:

const formConfig: ObjectConfig<SaveProjectItem> = {
  bidItem: { type: "value", localKeys: "name" }
}

const jsx = <LazyBoundBidItemSelect field={form.bidItem}

And be able to pass the SelectField.options: initial + lambda

Questions:

  • Is formConfig.bidItem a type: "value" or type: "object" with nested keys?
  • Is the type of LazyBoundBidItemSelect a FieldState<{ id: string; name: string}> or an ObjectState<{ ... }>? Does it matter?
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

No branches or pull requests

1 participant