Skip to content

Commit

Permalink
Use graphql.HasOperationContext in arangodb assembler (#1659)
Browse files Browse the repository at this point in the history
Signed-off-by: Ridwan Hoq <[email protected]>
  • Loading branch information
ridhoq authored Jan 23, 2024
1 parent 91a9be2 commit f393612
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/assembler/backends/arangodb/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ func (c *arangoClient) Packages(ctx context.Context, pkgSpec *model.PkgSpec) ([]
return []*model.Package{p}, nil
}

if _, ok := ctx.Value("graphql").(graphql.OperationContext); ok {
if graphql.HasOperationContext(ctx) {
// fields: [type namespaces namespaces.namespace namespaces.names namespaces.names.name namespaces.names.versions
// namespaces.names.versions.version namespaces.names.versions.qualifiers namespaces.names.versions.qualifiers.key
// namespaces.names.versions.qualifiers.value namespaces.names.versions.subpath]
Expand Down
2 changes: 1 addition & 1 deletion pkg/assembler/backends/arangodb/src.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func (c *arangoClient) Sources(ctx context.Context, sourceSpec *model.SourceSpec
}

// fields: [type namespaces namespaces.namespace namespaces.names namespaces.names.name namespaces.names.tag namespaces.names.commit]
if _, ok := ctx.Value("graphql").(graphql.OperationContext); ok {
if graphql.HasOperationContext(ctx) {
fields := getPreloads(ctx)

nameRequired := false
Expand Down
2 changes: 1 addition & 1 deletion pkg/assembler/backends/arangodb/vulnerability.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (c *arangoClient) Vulnerabilities(ctx context.Context, vulnSpec *model.Vuln
return []*model.Vulnerability{p}, nil
}

if _, ok := ctx.Value("graphql").(graphql.OperationContext); ok {
if graphql.HasOperationContext(ctx) {
// fields: [type vulnerabilityIDs ]
fields := getPreloads(ctx)

Expand Down

0 comments on commit f393612

Please sign in to comment.