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

Allow namespaces + additions to urls #20

Open
wisepotato opened this issue Mar 20, 2019 · 0 comments
Open

Allow namespaces + additions to urls #20

wisepotato opened this issue Mar 20, 2019 · 0 comments

Comments

@wisepotato
Copy link
Contributor

wisepotato commented Mar 20, 2019

So in a perfect world all models come from the same microservice, this would of course in the real world be a utopia.

In my case, I have a dedicated API Gateway (lets say https://graph.nao.com) and I have multiple microservices containing my model information. Lets say microservice A and B, which their urls being:

  • A : https://graph.nao.com/a/v1/*
  • B : https://graph.nao.com/b/v1/*

Now, I have a model on the first microservice, and one on the second. They share authentication, and are related to each other. Is this something we can support by means of:

@Model({namespace: 'a'})
export class ModelOnA extends Resource {
  @Field()
  public id: number;
  @Field()
  public name: string;
  @ToMany(ModelOnB): 
  public tasks: ToManyRelation<ModelOnA, ModelOnB>;
}
@Model({namespace: 'b'})
export class ModelOnB extends Resource {
  @Field()
  public id: number;
  @Field()
  public name: string;
  @ToMany(ModelOnA): 
  public tasks: ToManyRelation<ModelOnB, ModelOnA>;
}

A few things need to be done here:

  • Support namespaces
  • Support relationships between namespaces
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