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

Concatenate schemas with fields or other schemas #397

Open
georgolden opened this issue May 21, 2022 · 3 comments
Open

Concatenate schemas with fields or other schemas #397

georgolden opened this issue May 21, 2022 · 3 comments
Assignees

Comments

@georgolden
Copy link
Member

georgolden commented May 21, 2022

@lundibundi please edit

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

User { name: 'string' } => User { name: 'string', age: 'number', fullName: 'string' }

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

@georgolden georgolden changed the title Concatenate schemas Concatenate schemas with fields or other schemas May 21, 2022
@georgolden
Copy link
Member Author

@lundibundi I think it is better to create another schema rather then mixin into existing one. What do you think?

And how to deal with conflicts if 2 schemas have same field with different type? Error throw?

@georgolden
Copy link
Member Author

georgolden commented Jul 14, 2022

  1. create a fork of this repo
  2. use npm ci to install deps
  3. create a branch named feature/concat-schemas
  4. create a test for a this feature

Requirements.

  • This must be a method Schema.concat(...schemas ) returns new Schema that contains fields from 2 schemas.
  • If schemas are conflicting, e.g. they have similar fields with different typings, error must be thrown
  • metadata of resulting schema must contatin metadata from both schemas
  • if schemas have different KIND - throw error

@dmitryt
Copy link
Contributor

dmitryt commented Jul 30, 2022

I'd like to take this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants