Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Test:
When repo is not indexed, return data.
{ "operation": { "key": -1177702502, "query": { "kind": "Document", "definitions": [ { "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ResolveGitUrl" }, "variableDefinitions": [ { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "gitUrl" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } } ], "selectionSet": { "kind": "SelectionSet", "selections": [ { "kind": "Field", "name": { "kind": "Name", "value": "resolveGitUrl" }, "arguments": [ { "kind": "Argument", "name": { "kind": "Name", "value": "gitUrl" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "gitUrl" } } } ], "selectionSet": { "kind": "SelectionSet", "selections": [ { "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceKind" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "kind" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gitUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "refs" }, "selectionSet": { "kind": "SelectionSet", "selections": [ { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "commit" } } ] } } ] } } ] } } ], "loc": { "start": 0, "end": 200, "source": { "body": "query ResolveGitUrl($gitUrl: String!) {\n resolveGitUrl(gitUrl: $gitUrl) {\n id\n sourceId\n sourceKind\n sourceName\n name\n kind\n gitUrl\n refs {\n name\n commit\n }\n }\n}", "name": "gql", "locationOffset": { "line": 1, "column": 1 } } }, "__key": 4284452584 }, "variables": { "gitUrl": "[email protected]:sourcegraph/cody.git" }, "kind": "query", "context": { "url": "/graphql", "requestPolicy": "cache-and-network", "suspense": false, "meta": { "cacheOutcome": "miss" } } }, "data": { "resolveGitUrl": null }, "hasNext": false, "stale": false }
When repo is indexed, return data.
{ "operation": { "key": -4499522075, "query": { "kind": "Document", "definitions": [ { "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ResolveGitUrl" }, "variableDefinitions": [ { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "gitUrl" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } } ], "selectionSet": { "kind": "SelectionSet", "selections": [ { "kind": "Field", "name": { "kind": "Name", "value": "resolveGitUrl" }, "arguments": [ { "kind": "Argument", "name": { "kind": "Name", "value": "gitUrl" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "gitUrl" } } } ], "selectionSet": { "kind": "SelectionSet", "selections": [ { "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceKind" } }, { "kind": "Field", "name": { "kind": "Name", "value": "sourceName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "kind" } }, { "kind": "Field", "name": { "kind": "Name", "value": "gitUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "refs" }, "selectionSet": { "kind": "SelectionSet", "selections": [ { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "commit" } } ] } } ] } } ] } } ], "loc": { "start": 0, "end": 200, "source": { "body": "query ResolveGitUrl($gitUrl: String!) {\n resolveGitUrl(gitUrl: $gitUrl) {\n id\n sourceId\n sourceKind\n sourceName\n name\n kind\n gitUrl\n refs {\n name\n commit\n }\n }\n}", "name": "gql", "locationOffset": { "line": 1, "column": 1 } } }, "__key": 4284452584 }, "variables": { "gitUrl": "[email protected]:antimonyGu/tabby.git" }, "kind": "query", "context": { "url": "/graphql", "requestPolicy": "network-only", "suspense": false } }, "data": { "resolveGitUrl": { "id": "git:E16n1q", "sourceId": "git:E16n1q", "sourceKind": "GIT", "sourceName": "https://github.com/antimonyGu/tabby", "name": "my-tabby", "kind": "GIT", "gitUrl": "https://github.com/antimonyGu/tabby", "refs": [ { "name": "refs/heads/main", "commit": "3df11d1eb3c3d652ef715f644eb1f44730ff255f" }, { "name": "refs/tags/nightly", "commit": "3df11d1eb3c3d652ef715f644eb1f44730ff255f" } ] } }, "hasNext": false, "stale": false }