Keep deleted issue author as ghost

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](https://api.github.com/repos/andrew-d/static-binaries/issues/22).

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

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!

1 Like