Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 3

Keep deleted issue author as ghost

Solved! Go to Solution.

Now if the user account is deleted, GraphQL returns `null`, while REST v3 returns `ghost`. For example,

 

```

query {
   repository(owner: "andrew-d", name: "static-binaries") {
     issue(number: 22) {
       author {
         login
       }
    }
  }
}

```

 

Compared with, `https://api.github.com/repos/andrew-d/static-binaries/issues/22`.

2 Replies
Moderator
Message 2 of 3

Re: Keep deleted issue author as ghost

Thanks for the feedback. I'm investigating this and will get back to you as soon as I have more information.

Solution
Moderator
Message 3 of 3

Re: Keep deleted issue author as ghost

In talking with the developers, this was a deliberate design decision to make this change for the GraphQL API. For example, imagine this query:

 

query {
   repository(owner: "foo", name: "bar") {
     issue(number: 22) {
       author {
         ...on User {
          repositories(first: 10) {
            nodes {
              nameWithOwner
            }
          }
        }
      }
    }
  }
}

 

By returning a `User.ghost` for the issue author in this case, we then present a bunch of data about the ghost user (or no data), which is (at best) useless to the user, and at worst will lead them to mis-associate information.

 

Instead, by returning `null`, we are able to indicate exactly where in the graph there is no longer valid information.

 

I hope that helps!