Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066242
D8857.id31930.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Subscribers
None
D8857.id31930.diff
View Options
diff --git a/swh/graphql/resolvers/directory_entry.py b/swh/graphql/resolvers/directory_entry.py
--- a/swh/graphql/resolvers/directory_entry.py
+++ b/swh/graphql/resolvers/directory_entry.py
@@ -31,7 +31,7 @@
# STORAGE-TODO, archive is returning a dict
# return DirectoryEntry object instead
return self.archive.get_directory_entry_by_path(
- directory_id=self.kwargs.get("directorySwhid").object_id,
+ directory_id=self.kwargs.get("directorySWHID").object_id,
path=self.kwargs.get("path"),
)
diff --git a/swh/graphql/resolvers/resolvers.py b/swh/graphql/resolvers/resolvers.py
--- a/swh/graphql/resolvers/resolvers.py
+++ b/swh/graphql/resolvers/resolvers.py
@@ -262,7 +262,7 @@
return ConnectionObjectFactory.create("directory-entries", obj, info, **kw)
-@query.field("resolveSwhid")
+@query.field("resolveSWHID")
def search_swhid_resolver(
obj: None, info: GraphQLResolveInfo, **kw
) -> rs.search.ResolveSwhidConnection:
diff --git a/swh/graphql/schema/schema.graphql b/swh/graphql/schema/schema.graphql
--- a/swh/graphql/schema/schema.graphql
+++ b/swh/graphql/schema/schema.graphql
@@ -1066,7 +1066,7 @@
"""
SWHID of the directory object
"""
- directorySwhid: SWHID!
+ directorySWHID: SWHID!
"""
Relative path to the requested object
@@ -1098,7 +1098,7 @@
"""
Resolve the given SWHID to an object
"""
- resolveSwhid(
+ resolveSWHID(
"""
SWHID to look for
"""
diff --git a/swh/graphql/tests/functional/test_directory_entry.py b/swh/graphql/tests/functional/test_directory_entry.py
--- a/swh/graphql/tests/functional/test_directory_entry.py
+++ b/swh/graphql/tests/functional/test_directory_entry.py
@@ -26,7 +26,7 @@
path = "missing"
query_str = """
query getDirEntry($swhid: SWHID!, $path: String!) {
- directoryEntry(directorySwhid: $swhid, path: $path) {
+ directoryEntry(directorySWHID: $swhid, path: $path) {
name {
text
}
@@ -55,7 +55,7 @@
storage = server.get_storage()
query_str = """
query getDirEntry($swhid: SWHID!, $path: String!) {
- directoryEntry(directorySwhid: $swhid, path: $path) {
+ directoryEntry(directorySWHID: $swhid, path: $path) {
name {
text
}
diff --git a/swh/graphql/tests/functional/test_swhid_resolve.py b/swh/graphql/tests/functional/test_swhid_resolve.py
--- a/swh/graphql/tests/functional/test_swhid_resolve.py
+++ b/swh/graphql/tests/functional/test_swhid_resolve.py
@@ -18,7 +18,7 @@
def test_invalid_swhid(client):
query_str = """
query resolve($swhid: SWHID!) {
- resolveSwhid(swhid: $swhid) {
+ resolveSWHID(swhid: $swhid) {
nodes {
targetType
}
@@ -44,7 +44,7 @@
def test_missing_swhid(client, swhid):
query_str = """
query resolve($swhid: SWHID!) {
- resolveSwhid(swhid: $swhid) {
+ resolveSWHID(swhid: $swhid) {
nodes {
targetType
}
@@ -53,14 +53,14 @@
"""
data, _ = utils.get_query_response(client, query_str, swhid=swhid)
# API will return an empty list in case of a valid, non existing SWHID
- assert data == {"resolveSwhid": {"nodes": []}}
+ assert data == {"resolveSWHID": {"nodes": []}}
@pytest.mark.parametrize("snapshot", get_snapshots())
def test_snapshot_swhid_resolve(client, snapshot):
query_str = """
query resolve($swhid: SWHID!) {
- resolveSwhid(swhid: $swhid) {
+ resolveSWHID(swhid: $swhid) {
nodes {
targetType
target {
@@ -75,7 +75,7 @@
"""
data, _ = utils.get_query_response(client, query_str, swhid=str(snapshot.swhid()))
assert data == {
- "resolveSwhid": {
+ "resolveSWHID": {
"nodes": [
{
"target": {
@@ -93,7 +93,7 @@
def test_revision_swhid_resolve(client, revision):
query_str = """
query resolve($swhid: SWHID!) {
- resolveSwhid(swhid: $swhid) {
+ resolveSWHID(swhid: $swhid) {
nodes {
targetType
target {
@@ -108,7 +108,7 @@
"""
data, _ = utils.get_query_response(client, query_str, swhid=str(revision.swhid()))
assert data == {
- "resolveSwhid": {
+ "resolveSWHID": {
"nodes": [
{
"target": {
@@ -126,7 +126,7 @@
def test_release_swhid_resolve(client, release):
query_str = """
query resolve($swhid: SWHID!) {
- resolveSwhid(swhid: $swhid) {
+ resolveSWHID(swhid: $swhid) {
nodes {
targetType
target {
@@ -141,7 +141,7 @@
"""
data, _ = utils.get_query_response(client, query_str, swhid=str(release.swhid()))
assert data == {
- "resolveSwhid": {
+ "resolveSWHID": {
"nodes": [
{
"target": {
@@ -159,7 +159,7 @@
def test_directory_swhid_resolve(client, directory):
query_str = """
query resolve($swhid: SWHID!) {
- resolveSwhid(swhid: $swhid) {
+ resolveSWHID(swhid: $swhid) {
nodes {
targetType
target {
@@ -174,7 +174,7 @@
"""
data, _ = utils.get_query_response(client, query_str, swhid=str(directory.swhid()))
assert data == {
- "resolveSwhid": {
+ "resolveSWHID": {
"nodes": [
{
"target": {
@@ -192,7 +192,7 @@
def test_content_swhid_resolve(client, content):
query_str = """
query resolve($swhid: SWHID!) {
- resolveSwhid(swhid: $swhid) {
+ resolveSWHID(swhid: $swhid) {
nodes {
targetType
target {
@@ -207,7 +207,7 @@
"""
data, _ = utils.get_query_response(client, query_str, swhid=str(content.swhid()))
assert data == {
- "resolveSwhid": {
+ "resolveSWHID": {
"nodes": [
{
"target": {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Nov 5 2024, 3:36 AM (8 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3217956
Attached To
D8857: Use wordSWHID instead of wordSwhid in schema for consistency
Event Timeline
Log In to Comment