diff --git a/nomad/app/v1/routers/graph.py b/nomad/app/v1/routers/graph.py
index e24fb048ef1045c298334ef98ffe3cb637ac601e..6f01f4845c5c495893a9fd1d4593fe98f8939329 100644
--- a/nomad/app/v1/routers/graph.py
+++ b/nomad/app/v1/routers/graph.py
@@ -142,6 +142,6 @@ async def archive_query(
         del graph_dict[Token.SEARCH]['m_request']['query']
 
     with UserReader(graph_dict, user=user) as reader:
-        response: dict = await reader.read(user.user_id)
+        response: dict = await reader.read(user.user_id if user else '')
 
     return GraphJSONResponse(response)