github-community-projects / github-community-projects/graphql-client

Errors not populating correctly

Aperta
#75 1 commento 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Ruby
Stelle
78
Fork
228
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Given this response

```ruby
#::Mutation addUser=nil>,
@errors=#,
@extensions=nil,
@full_response=
{"connection" => ["close"],
"server" => ["TwistedWeb/24.3.0"],
"date" => ["Wed, 18 Jun 2025 12:45:29 GMT"],
"content-type" => ["application/json"],
"content-length" => ["338"]},
@original_hash=
{"data" => {"addUser" => nil},
"errors" =>
[{"message" => "The provided field is not unique and already exists in GUS.",
"locations" => [{"line" => 2, "column" => 3}],
"path" => ["addUser"],
"errorType" => "FieldExistsError",
"data" => nil,
"errorInfo" => {"errorType" => "FieldExistsError", "field" => "userPrincipalName", "value" => "foo@bar.com"}}]}>
```

The errors object is empty even though there is an error returned. I tried stepping through I was able to get the errors object after being normalized which yielded

```
{"message" => "The provided field is not unique and already exists in GUS.",
"locations" => [{"line" => 2, "column" => 3}],
"path" => ["addUser"],
"errorType" => "FieldExistsError",
"data" => nil,
"errorInfo" => {"errorType" => "FieldExistsError", "field" => "userPrincipalName", "value" => "foo@bar.com"},
"normalizedPath" => ["data", "addUser"]}
```

I'm assuming it's part of the AST check for errors but I don't really get how it works or what's missing

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia tracciando il modo in cui gli errori della risposta vengono normalizzati in GraphQL::Client::Errors, quindi esamina il controllo dell’AST per verificare gli errori menzionati nel report. Riproduci la risposta mostrata nell’issue e verifica che l’errore GraphQL restituito popoli l’oggetto errors invece di lasciare vuoti i relativi messages e details.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
graphql, ruby
Ambito
api, backend
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.