2016-09-17 5 views
6

Ich habe eine GraphQL-Abfrage. Ich kann nicht verstehen, warum es nicht funktioniert.Github graphQL OrderBy

{ 
    repositoryOwner(login: "Naramsim") { 
    login 
    repositories(first: 3, isFork: true, orderBy: {field: CREATED_AT}) { 
     edges { 
     node { 
      description 
     } 
     } 
    } 
    } 
} 

Link

Antwort

18

Sie haben einen Fehler bekam

Argument 'orderBy' on Field 'repositories' has an invalid value. 
Expected type 'RepositoryOrder'. 

Sie vergessen Richtung angeben, die als obligatorisch gekennzeichnet ist. Das wird funktionieren:

{ 
    repositoryOwner(login: "Naramsim") { 
    login 
    repositories(first: 3, isFork: true, orderBy: {field: CREATED_AT, direction: ASC}) { 
     edges { 
     node { 
      description 
     } 
     } 
    } 
    } 
} 
+0

Ja das ist die richtige Antwort. –