hasura / json2graphql

From a JSON file to postgres-backed realtime GraphQL
MIT License
201 stars 23 forks source link

[Question] Data structure not correct? #13

Open scheung38 opened 4 years ago

scheung38 commented 4 years ago
data = ['id,Name,Type1,Type2,HP,Attack,Defense,SpecialAtk,SpecialDef,Speed,Generation,Legendary,Mega\n', '1,Bulbasaur,Grass,Poison,45,49,49,65,65,45,1,FALSE,FALSE\n', '2,Ivysaur,Grass,Poison,60,62,63,80,80,60,1,FALSE,FALSE\n', '3,Mega Venusaur,Grass,Poison,80,100,123,122,120,80,1,FALSE,TRUE\n',

with open('Final-Problem-1/abc.json', 'w') as outfile:
    json.dump(data, outfile, indent=4)

abc.json

{ "pokedex" :
    [
    "id,Name,Type1,Type2,HP,Attack,Defense,SpecialAtk,SpecialDef,Speed,Generation,Legendary,Mega\n",
    "1,Bulbasaur,Grass,Poison,45,49,49,65,65,45,1,FALSE,FALSE\n",
    "2,Ivysaur,Grass,Poison,60,62,63,80,80,60,1,FALSE,FALSE\n",
    ]
}

json2graphql

Verifying URL... Done! Processing JSON data... Error message: a unique column with name "id" must present in table "pokedex"

qbunt commented 3 years ago

@scheung38 this looks like invalid JSON to me?