diff --git a/swh/graphql/resolvers/base_node.py b/swh/graphql/resolvers/base_node.py --- a/swh/graphql/resolvers/base_node.py +++ b/swh/graphql/resolvers/base_node.py @@ -77,5 +77,5 @@ class BaseSWHNode(BaseNode): @property - def SWHID(self): + def swhid(self): return self._node.swhid() diff --git a/swh/graphql/resolvers/content.py b/swh/graphql/resolvers/content.py --- a/swh/graphql/resolvers/content.py +++ b/swh/graphql/resolvers/content.py @@ -32,9 +32,9 @@ def _get_node_data(self): """ When a content is requested directly - with its SWHID + with its swhid """ - return self._get_content_by_id(self.kwargs.get("SWHID").object_id) + return self._get_content_by_id(self.kwargs.get("swhid").object_id) class TargetContentNode(BaseContentNode): diff --git a/swh/graphql/resolvers/directory.py b/swh/graphql/resolvers/directory.py --- a/swh/graphql/resolvers/directory.py +++ b/swh/graphql/resolvers/directory.py @@ -23,9 +23,9 @@ class DirectoryNode(BaseDirectoryNode): def _get_node_data(self): """ - When a directory is requested directly with its SWHID + When a directory is requested directly with its swhid """ - directory_id = self.kwargs.get("SWHID").object_id + directory_id = self.kwargs.get("swhid").object_id # path = "" if archive.Archive().is_directory_available([directory_id]): return self._get_directory_by_id(directory_id) @@ -37,7 +37,7 @@ """ When a directory is requested from a revision self.obj is revision here - self.obj.directorySWHID is the required dir SWHID + self.obj.directorySWHID is the required dir swhid (set from resolvers.revision.py:BaseRevisionNode) """ directory_id = self.obj.directorySWHID.object_id 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 @@ -24,7 +24,7 @@ def _get_paged_result(self): """ When entries requested from a directory - self.obj.SWHID is the directory SWHID here + self.obj.swhid is the directory swhid here This is not paginated from swh-storgae using dummy pagination @@ -34,6 +34,6 @@ # To remove localpagination, just drop the paginated call # STORAGE-TODO entries = ( - archive.Archive().get_directory_entries(self.obj.SWHID.object_id).results + archive.Archive().get_directory_entries(self.obj.swhid.object_id).results ) return utils.paginated(entries, self._get_first_arg(), self._get_after_arg()) diff --git a/swh/graphql/resolvers/release.py b/swh/graphql/resolvers/release.py --- a/swh/graphql/resolvers/release.py +++ b/swh/graphql/resolvers/release.py @@ -31,11 +31,11 @@ class ReleaseNode(BaseReleaseNode): """ - When the release is requested directly with its SWHID + When the release is requested directly with its swhid """ def _get_node_data(self): - return self._get_release_by_id(self.kwargs.get("SWHID").object_id) + return self._get_release_by_id(self.kwargs.get("swhid").object_id) class TargetReleaseNode(BaseReleaseNode): diff --git a/swh/graphql/resolvers/revision.py b/swh/graphql/resolvers/revision.py --- a/swh/graphql/resolvers/revision.py +++ b/swh/graphql/resolvers/revision.py @@ -44,11 +44,11 @@ class RevisionNode(BaseRevisionNode): """ - When the revision is requested directly with its SWHID + When the revision is requested directly with its swhid """ def _get_node_data(self): - return self._get_revision_by_id(self.kwargs.get("SWHID").object_id) + return self._get_revision_by_id(self.kwargs.get("swhid").object_id) class TargetRevisionNode(BaseRevisionNode): @@ -69,7 +69,7 @@ revision self.obj is the current(child) revision self.obj.parentSWHIDs is the list of - parent SWHIDs + parent swhids """ _node_class = BaseRevisionNode @@ -95,7 +95,7 @@ def _get_paged_result(self): # STORAGE-TODO (date in revisionlog is a dict) - log = archive.Archive().get_revision_log([self.obj.SWHID.object_id]) + log = archive.Archive().get_revision_log([self.obj.swhid.object_id]) # FIXME, using dummy(local) pagination, move pagination to backend # To remove localpagination, just drop the paginated call # STORAGE-TODO (pagination) diff --git a/swh/graphql/resolvers/snapshot.py b/swh/graphql/resolvers/snapshot.py --- a/swh/graphql/resolvers/snapshot.py +++ b/swh/graphql/resolvers/snapshot.py @@ -21,12 +21,12 @@ class SnapshotNode(BaseSnapshotNode): """ - For directly accessing a snapshot with its SWHID + For directly accessing a snapshot with its swhid """ def _get_node_data(self): """ """ - snapshot_id = self.kwargs.get("SWHID").object_id + snapshot_id = self.kwargs.get("swhid").object_id if archive.Archive().is_snapshot_available([snapshot_id]): return self._get_snapshot_by_id(snapshot_id) return None @@ -40,7 +40,7 @@ def _get_node_data(self): """ self.obj is visitstatus here - self.obj.snapshotSWHID is the requested snapshot SWHID + self.obj.snapshotSWHID is the requested snapshot swhid """ snapshot_id = self.obj.snapshotSWHID.object_id return self._get_snapshot_by_id(snapshot_id) diff --git a/swh/graphql/resolvers/snapshot_branch.py b/swh/graphql/resolvers/snapshot_branch.py --- a/swh/graphql/resolvers/snapshot_branch.py +++ b/swh/graphql/resolvers/snapshot_branch.py @@ -45,12 +45,12 @@ def _get_paged_result(self): """ When branches requested from a snapshot - self.obj.SWHID is the snapshot SWHID here + self.obj.swhid is the snapshot swhid here (as returned from resolvers/snapshot.py) """ result = archive.Archive().get_snapshot_branches( - self.obj.SWHID.object_id, + self.obj.swhid.object_id, after=self._get_after_arg(), first=self._get_first_arg(), target_types=self.kwargs.get("types"), 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 @@ -20,13 +20,13 @@ } """ -SWH merkle node object with a SWHID +SWH merkle node object with a swhid """ interface MerkleNode { """ - SWHID of the object + Swhid of the object """ - SWHID: SWHID! + swhid: SWHID! } """ @@ -334,9 +334,9 @@ id: ID! """ - SWHID of the snapshot object + Swhid of the snapshot object """ - SWHID: SWHID! + swhid: SWHID! """ Connection to all the snapshot branches @@ -511,9 +511,9 @@ id: ID! """ - SWHID of the revision object + Swhid of the revision object """ - SWHID: SWHID! + swhid: SWHID! """ Message associated to the revision @@ -600,9 +600,9 @@ id: ID! """ - SWHID of the release object + Swhid of the release object """ - SWHID: SWHID! + swhid: SWHID! """ The name of the release @@ -718,9 +718,9 @@ id: ID! """ - SWHID of the directory object + Swhid of the directory object """ - SWHID: SWHID! + swhid: SWHID! """ Connection to the directory entries @@ -769,9 +769,9 @@ id: ID! """ - SWHID of the content object + Swhid of the content object """ - SWHID: SWHID! + swhid: SWHID! """ Checksums for the content @@ -839,52 +839,52 @@ ): Visit """ - Get the snapshot with a SWHID + Get the snapshot with a swhid """ snapshot( """ - SWHID of the snapshot object + Swhid of the snapshot object """ - SWHID: SWHID! + swhid: SWHID! ): Snapshot """ - Get the revision with a SWHID + Get the revision with a swhid """ revision( """ - SWHID of the revision object + Swhid of the revision object """ - SWHID: SWHID! + swhid: SWHID! ): Revision """ - Get the release with a SWHID + Get the release with a swhid """ release( """ - SWHID of the release object + Swhid of the release object """ - SWHID: SWHID! + swhid: SWHID! ): Release """ - Get the directory with a SWHID + Get the directory with a swhid """ directory( """ - SWHID of the directory object + Swhid of the directory object """ - SWHID: SWHID! + swhid: SWHID! ): Directory """ - Get the content with a SWHID + Get the content with a swhid """ content( """ - SWHID of the content object + Swhid of the content object """ - SWHID: SWHID! + swhid: SWHID! ): Content }