GithubHelp home page GithubHelp logo

json2graphql's People

Contributors

dependabot[bot] avatar dpisanu avatar ecthiender avatar nizar-m avatar rakeshkky avatar russc avatar shahidhk avatar shark-h avatar wawhal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

json2graphql's Issues

expected atleast one query in bulk

What does this error mean ?

Verifying URL... Done!
Processing JSON data... Done!
Checking database... Skipped!
Creating tables... Done!
Tracking tables... Done!
Creating relationships... Error
{
  "path": "$",
  "error": "expected atleast one query in bulk",
  "code": "bad-request"
}

This example works:

{
    "post": [
        { "id": 1, "title": "Lorem Ipsum", "views": 254, "user_id": 123 },
        { "id": 2, "title": "Sic Dolor amet", "views": 65, "user_id": 456 }
    ],
    "user": [
        { "id": 123, "name": "John Doe" },
        { "id": 456, "name": "Alison Craus" }
    ],
    "comment": [
        { "id": 987, "post_id": 1, "body": "Consectetur adipiscing elit", "user_id": 123 },
        { "id": 995, "post_id": 2, "body": "Nam molestie pellentesque dui", "user_id": 456 },
        { "id": 999, "post_id": 1, "body": "quid agis", "user_id": 456 }
    ]
}

My simple json does not:


{
  "events": [
    {
      "id": 1,
      "case": "xxxx",
      "link": "https://google.com",
      "document": "18",
      "time": "02:30 PM",
      "description": "doc18",
      "AllJudges": "Hearing John Doe.",
      "HearingJudge": "John Doe",
      "PresiderJudge": "Doe John"
    },
    {
      "id": 1,
      "case": "xxxx",
      "link": "https://google.com",
      "document": "18",
      "time": "02:30 PM",
      "description": "doc18",
      "AllJudges": "Hearing John Doe.",
      "HearingJudge": "John Doe",
      "PresiderJudge": "Doe John"
    }
  ]
}

jsontographql option for data appending

JSON2GRPAHQL TOOL Currently either overwrites the table or throws table existing error.

Can we change the behaviour to start appending the data to existing instead of table existing error

[Question] Data structure not correct?

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"

No flag for setting data on anything other than a database named `default`

There's no way to import data into a database not named anything other than default, and the --db flag is currently taken up by the file to import. This is not that uncommon a case, and the normal Hasura CLI has ways to point to a specific database alone.

It seems that this project does not get a lot of love, are PRs currently being accepted or is this module looking for maintainers?

Permissions for each table optionally set by the command line

Hello Hasura/json2graphql team,

First I want to say I have really enjoyed using this tool. There is at least one thing I do think it is missing though, if you want to push using --overwrite you will loose your permissions, and even if you don't overwrite, it appears you cannot currently set permissions. I be happy to see json2graphql set permissions via command line at the same time as it sets the data. It would be great to use the db.json data itself to set permissions if possible (or another file if that is preferred).

This is the currently suggested json:

    {
        "post": [
            { "id": 1, "title": "Lorem Ipsum", "views": 254, "user_id": 123 },
            { "id": 2, "title": "Sic Dolor amet", "views": 65, "user_id": 456 }
        ],
        "user": [
            { "id": 123, "name": "John Doe" },
            { "id": 456, "name": "Alison Craus" }
        ],
        "comment": [
            { "id": 987, "post_id": 1, "body": "Consectetur adipiscing elit", "user_id": 123 },
            { "id": 995, "post_id": 2, "body": "Nam molestie pellentesque dui", "user_id": 456 },
            { "id": 999, "post_id": 1, "body": "quid agis", "user_id": 456 }
        ]
    }

Perhaps it could look like this instead:

    {
        "post": [
            { "id": 1, "title": "Lorem Ipsum", "views": 254, "user_id": 123 },
            { "id": 2, "title": "Sic Dolor amet", "views": 65, "user_id": 456 }
        ],
        "user": [
            { "id": 123, "name": "John Doe" },
            { "id": 456, "name": "Alison Craus" }
        ],
        "comment": [
            { "id": 987, "post_id": 1, "body": "Consectetur adipiscing elit", "user_id": 123 },
            { "id": 995, "post_id": 2, "body": "Nam molestie pellentesque dui", "user_id": 456 },
            { "id": 999, "post_id": 1, "body": "quid agis", "user_id": 456 }
        ],

        /** OPTIONAL: permissions section, so that changing the data does not wipe the permissions */
        "permissions": {
            "post": {
                "roles": {
                    /** admin is a default, thus it does not need to be listed or changed */
                    
                    "anonymous": {
                        /** when allowing via custom check something like this */
                        "insert": {
                            "With custom check:": {
                                /** this is exactly the same as is shown in the data tab */
                                "users_id": { "_eq": "X-Hasura-User-Id" },
                                /** with the addition of a columns */
                                "columns": ["title", "views"]
                            }
                        },
                    
                        /** when allowing all columns without any checks, for all columns */
                        "select": { "Without any checks": { "columns": ["*"]} },
                        
                        /** when you just want to keep no permissions for a statement */
                        "update": {},
                    
                        /** when allowing via custom check for all columns, you can omit the columns or use a wildcard */
                        "delete": {
                            "With custom check:": {
                                "users_id": { "_eq": "X-Hasura-User-Id" },
                                "columns": ["*"]
                            }
                        }
                    }
                }
            }
        }
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.