Skip to content

Error fetching commit author info from GraphQL API

Created by: dadlerj

  • Sourcegraph version: sgdev

(Not entirely sure who to assign this to, so I just grabbed the core team. Feel free to reassign.)

Reported by a customer:

Any ideas about potential workaround to get this data on search results until a fix is live?

Steps to reproduce:

  1. Run the query at https://sourcegraph.sgdev.org/api/console#%7B%22query%22%3A%22query%20(%24query%3A%20String!)%20%7B%5Cn%20%20search(query%3A%20%24query)%20%7B%5Cn%20%20%20%20results%20%7B%5Cn%20%20%20%20%20%20results%20%7B%5Cn%20%20%20%20%20%20%20%20...%20on%20FileMatch%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20file%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20commit%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20author%20%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20person%7B%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20email%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%7D%5Cn%20%20%20%20%20%20%20%20%20%20%7D%5Cn%20%20%20%20%20%20%20%20%7D%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%7D%5Cn%22%2C%22variables%22%3A%22%7B%5Cn%20%20%5C%22query%5C%22%3A%20%5C%22sourcegraph%2Fsourcegraph%5C%22%5Cn%7D%22%7D

  2. See error:

image

The same issue exists for all fields within the person object, but does not occur for other fields in the author object one level above that.

Expected behavior:

Author information should be available

Actual behavior:

"json: error calling MarshalJSON for type json.RawMessage: invalid character '}' looking for beginning of value\n"

Looks like an unexpected empty string/nil error. Like the search API isn't populating that field for some reason?