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

/apps/ocean-api: GraphQLController #939

Closed
fuxingloh opened this issue Jan 4, 2022 · 3 comments
Closed

/apps/ocean-api: GraphQLController #939

fuxingloh opened this issue Jan 4, 2022 · 3 comments
Assignees
Labels

Comments

@fuxingloh
Copy link
Collaborator

As part of #580 consolidation efforts.

What would you like to be added:

GraphQLController implementation on /apps/ocean-api pulling data from jellyfish-indexer and jellyfish-database both are also WIP.

Why is this needed:

In whale-api, when we have a new business logic the DataModel implementation was very Aspect-oriented. We create an indexer, database model, REST controller, and client. This is massively cross-cutting and largely unscalable.

Instead of making each aspect a DataModel, we make the entire Model-Controller-Client an Aspect. Thus introducing a cross-cutting concern to centralize all Model-Controller-Client development into one aspect. And cutting down on indexer implementation fatigue as it will be properly consolidated too.

/sig ecosystem
/area apps
/triage accepted
/assign @monstrobishi

@fuxingloh
Copy link
Collaborator Author

/area packages

@monstrobishi
Copy link
Contributor

In terms of NestJS graphql is not really seen as a controller as it's all handled through type annotations and dependency injection. as long as a data model and resolver exists for a particular model it will be handled automatically

The structure is then as follows;
models
resolvers

Note in the future when we integrate typeorm, the annotations there can and should be applied to the exact same model classes, making the implementation very lean

@monstrobishi
Copy link
Contributor

A good outcome of this is that we can follow nestjs prescribed structure for GraphQL implementations leading to less bike shedding and design overhead

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

Successfully merging a pull request may close this issue.

3 participants