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
[schema] Add GraphQL layer for teams #562
Conversation
9604611
to
bb51cae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks good to me. Good job. Before we merging it, can you rebase it with muggle branch (I merged your other PR before).
I also have another question and I don't know if we can fix it in this PR. Probably we can do it in a different one. The thing is, when we run a query to ask for Teams, the fields related to the django tree package are visible. I think those fields shouldn't be exposed with the api cause they are details of the implementation but maybe I'm wrong. Also, if I understand correctly, it's not possible to ask for the children of a team. That's something that we should do because it's part of the idea of GraphQL.
About the implementation details - I think am a bit confused here, it doesnt return any of the fields like path and depth and num children in the graphQL response. Did you mean something else? About getting the children - I was thinking of this, it is just a different function call |
This commit adds the queries and mutations for handling Team objects in schema.py. The `AddTeam` mutation allows users to a new team to the registry. The `DeleteTeam` mutation allows users to delete existing teams from the registry. The `teams` query has four filters that can be used to search through teams in the registry. The filters are: name, term, organization and parent. Signed-off-by: Rashmi-K-A <k.a.rashmi04@gmail.com>
bb51cae
to
a02f4a0
Compare
It does. For example, if you run this query:
I get the next results for the two teams that I created:
This is because we're exposing these fields from the internal model. I'm not sure if it's possible to avoid it.
The descendants should be resolved within the query. I don't think we should add any filter to that. It should be something like:
It's not mandatory to have it now but I think it's something we need because it's kind of the purpose of having graphql and a REST API, for example. |
@sduenas Oh! I did not notice that. Can we not use |
Sure, I think we can work out a way to do that. I ll make note of it for now and we can circle back to it when the UI is done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I merged the PR but I'm going to open two issues to try to resolve the open questions of this PR. |
This PR includes the changes for extending the GraphQL layer to manipulate Team objects. It adds a query for searching through Team objects and two mutations -
AddTeam
andDeleteTeam
for creating and deleting Team objects respectively.This PR closes #558.