Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 203e505

Browse files
Move usages API to top-level
1 parent df4fb88 commit 203e505

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

cmd/frontend/graphqlbackend/codeintel.codenav.graphql

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -246,19 +246,6 @@ type GitBlobLSIFData implements TreeEntryLSIFData {
246246
character: Int!
247247
): Hover
248248

249-
"""
250-
Either one of 'symbol' or 'range' must be provided, but this isn't enforced at the GraphQL
251-
layer due to the lack of support for input unions.
252-
https://github.com/graphql/graphql-wg/blob/main/rfcs/InputUnion.md
253-
"""
254-
usages(
255-
symbol: LookupSCIPSymbol,
256-
range: LookupRange,
257-
filter: UsagesFilter,
258-
first: Int,
259-
after: String,
260-
): UsageConnection!
261-
262249
"""
263250
Code diagnostics provided through LSIF.
264251
"""
@@ -275,6 +262,19 @@ type GitBlobLSIFData implements TreeEntryLSIFData {
275262
snapshot(indexID: ID!): [SnapshotData!]
276263
}
277264

265+
extend type Query {
266+
usagesForSymbol(
267+
symbol: LookupSCIPSymbol,
268+
"""
269+
Non-optional due to implementation limitations
270+
"""
271+
range: LookupRange!,
272+
filter: UsagesFilter,
273+
first: Int,
274+
after: String,
275+
): UsageConnection!
276+
}
277+
278278
input LookupSCIPSymbol {
279279
name: SymbolNameComparator!
280280
provenance: ProvenanceComparator!
@@ -297,8 +297,24 @@ type SCIPSymbol {
297297
}
298298

299299
input LookupRange {
300-
start: LookupPosition!
301-
end: LookupPosition!
300+
"""
301+
Defaults to instance-wide search if the repo is not specified.
302+
303+
This field is non-optional due to implementation limitations.
304+
"""
305+
repo: String!
306+
"""
307+
Defaults to HEAD of the default branch if not specified.
308+
"""
309+
revision: String
310+
"""
311+
Defaults to repo-wide search if the path is not specified.
312+
313+
This field is non-optional due to implementation limitations.
314+
"""
315+
path: String!
316+
start: LookupPosition
317+
end: LookupPosition
302318
}
303319

304320
input LookupPosition {
@@ -310,7 +326,6 @@ input UsagesFilter {
310326
and: [UsagesFilter!]
311327
or: [UsagesFilter!]
312328
not: UsagesFilter
313-
# TODO: Can we be flexible here and allow patterns while still maintaining fast queries.
314329
repository: RepositoryFilter
315330
path: PathFilter
316331
kind: SymbolUsageKind

0 commit comments

Comments
 (0)