GraphQL Schema type error when referencing existing index

The error happens because of how the @index works. It expectats that argument names and types match exactly with the fields of the output type. You set your User argument to an ID type, but the Passage user type has field User: User.

If you want to provide this custom functionality, you will need to use the @resolver directive, instead of @index.

That said, I strongly recommend you consider using built in relations before going the custom route.

A more idiomatic approach

You can do this out of the box with GraphQL. You will need to provide a field on the User for connected Passages. I know you said that a User does not know anything about Passages, but you are in fact querying in that way.

Here is a similar question for querying all Todos for a given user.

Rather than provide the related ID, the more idiomatic GraphQL approach is to to query the User, then expand the related fields.

The reason that this way is preferred is that the query results represent your actual “graph” of data. If you create a custom resolver to take an User ID and skip over the user in the results, then you lose your ability to reason about the graph fully. One practical consequence is that you might break your local cache, like what Apollo Client uses, but if you return the whole graph then your cache stays up to date without additional work to link everything together.

type User {
  ...
  passages: [Passage]! @relation
}

type Passage {
  ...
  user:User @relation
}

Then you can immediately query for all Passages for a given User

{
  findUserById(id: "1234") { # <- auto-generated query
    _id
    # other User fields
    passages: {
      after     # pagination is build in!
      data {
        _id
        # other Passage fields
      }
    }
  }
}