8000 Add source trie GraphQL schema by pxp928 · Pull Request #398 · guacsec/guac · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add source trie GraphQL schema #398

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

Merged
merged 5 commits into from
Feb 3, 2023
Merged

Conversation

pxp928
Copy link
Collaborator
@pxp928 pxp928 commented Feb 2, 2023

Add source trie with type, namespace, name, and qualifier that can be specified as either a tag or commit, or nothing. Testing done via the testing backend. Neo4j resolver implementation in another PR.

fragment allSrcTree on Source {
  type
  namespaces {
    namespace
    names {
      name
      tag
      commit
    }
  }
}

query Q1 {
  sources(sourceSpec: {name: "github.com/guacsec/guac"}) {
    ...allSrcTree
  }
}

query Q2 {
  sources(sourceSpec: {qualifier: {tag: "v0.0.1"}}) {
    ...allSrcTree
  }
}

query Q3 {
  sources(
    sourceSpec: {qualifier: {commit: "fcba958b73e27cad8b5c8655d46439984d27853b"}}
  ) {
    ...allSrcTree
  }
}

query Q4 {
  sources(sourceSpec: {qualifier: {}}) {
    ...allSrcTree
  }
}

query Q5 {
  sources(sourceSpec: {type: "svn"}) {
    ...allSrcTree
  }
}

query Q6 {
  sources(sourceSpec: {namespace: "gitlab"}) {
    ...allSrcTree
  }
}

query Q7 {
  sources(sourceSpec: {}) {
    ...allSrcTree
  }
}

query Q8 {
  sources(sourceSpec: {qualifier: {tag: "asd", commit: "sad"}}) {
    ...allSrcTree
  }
}

Signed-off-by: pxp928 <parth.psu@gmail.com>
@pxp928 pxp928 requested a review from mihaimaruseac as a code owner February 2, 2023 19:52
@pxp928 pxp928 requested a review from lumjjb February 2, 2023 19:52
Signed-off-by: pxp928 <parth.psu@gmail.com>
@pxp928 pxp928 force-pushed the graphql-src-trie branch 3 times, most recently from 3a9d8cc to 0ce0ad8 Compare February 2, 2023 20:17
Signed-off-by: pxp928 <parth.psu@gmail.com>
Copy link
Collaborator
@mihaimaruseac mihaimaruseac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a suggestion to simplify qu 8000 ery and output

Signed-off-by: pxp928 <parth.psu@gmail.com>
Signed-off-by: pxp928 <parth.psu@gmail.com>
Copy link
Contributor
@lumjjb lumjjb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I will open up a ticket for helping to flesh out docs for graphQL, think it will be helpful in the future.

@kodiakhq kodiakhq bot merged commit 7ce905f into guacsec:main Feb 3, 2023
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 this pull request may close these issues.

3 participants
0