Decorators less verbose and subscriptions#14
Decorators less verbose and subscriptions#14felipesabino merged 29 commits intoindigotech:masterfrom
Conversation
|
How to use: |
| type?: any; | ||
| } | ||
|
|
||
| export interface ListOption { |
There was a problem hiding this comment.
Since all these description fileds mean the same thing and it is part of every available option object, what if you'd extract them to an interface and then you'd extend that interface from all those options?
Something like:
export interface DefaultOption {
description?: string;
}
export interface ObjectTypeOption extends DefaultOption { }There was a problem hiding this comment.
Yes I thought about that also but kept it for next step, I was thinking about refactoring current code base, for now everything (about decorators) is in one file and maybe it would be good to split it in separate files, file per decorator + 1 common file.
|
|
||
| export interface FieldOption { | ||
| type?: any; | ||
| description?: string; |
There was a problem hiding this comment.
What about the pagination? It would be nice to have it here as well.
There was a problem hiding this comment.
Yes I agree, but first I've implemented just description field to get your feedback and pagination can be implemented with the same way later.
|
Two more things apart from that
|
|
Okey, I'll need some time and I'll make those things |
@thiago-soliveira check out latest updates please |
|
Also its important your feedback about new sample project structure |
* completed subscription implementation * updated graphql up to 0.11.7
|
We have cool updates, I've added subscription implementation, and created demo in Apollo-server example |
thiago-soliveira
left a comment
There was a problem hiding this comment.
Very nice changes. The server example will help a lot on development and for users as an example.
+1 for the subscription as well.
Let's see how this new structure goes in real life. I think the code got more readable after these changes.
| const fields: {[key: string]: any} = {}; | ||
| let mutationTypeFn: Function; | ||
| let fieldMetadataList: FieldTypeMetadata[]; | ||
| // let result: any = { |
There was a problem hiding this comment.
Could you remove this code that is commented out?
Uh oh!
There was an error while loading. Please reload this page.