{"id":14976125,"url":"https://github.com/neo4j-graphql/graphql-cli-load","last_synced_at":"2025-10-27T18:30:21.871Z","repository":{"id":57253374,"uuid":"100790556","full_name":"neo4j-graphql/graphql-cli-load","owner":"neo4j-graphql","description":"A graphql-cli data import plugin to call mutations with data from JSON/CSV files","archived":false,"fork":false,"pushed_at":"2018-09-10T03:32:16.000Z","size":11,"stargazers_count":65,"open_issues_count":10,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-01T07:31:38.610Z","etag":null,"topics":["csv-import","data-import","graphql","graphql-cli","graphql-schema","import","json-data","mutations"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/graphql-cli-load","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neo4j-graphql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-19T11:39:34.000Z","updated_at":"2024-03-26T19:57:38.000Z","dependencies_parsed_at":"2022-08-31T22:20:16.970Z","dependency_job_id":null,"html_url":"https://github.com/neo4j-graphql/graphql-cli-load","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-graphql%2Fgraphql-cli-load","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-graphql%2Fgraphql-cli-load/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-graphql%2Fgraphql-cli-load/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-graphql%2Fgraphql-cli-load/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neo4j-graphql","download_url":"https://codeload.github.com/neo4j-graphql/graphql-cli-load/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238536041,"owners_count":19488641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv-import","data-import","graphql","graphql-cli","graphql-schema","import","json-data","mutations"],"created_at":"2024-09-24T13:53:21.336Z","updated_at":"2025-10-27T18:30:16.533Z","avatar_url":"https://github.com/neo4j-graphql.png","language":"TypeScript","readme":"# graphql-cli-load\n\nData import plugin for graphql-cli.\n\n## Installation\n\n```\nnpm i -g graphql-cli graphql-cli-load\n```\n\n## Configuration\n\nConfigure the plugin via the `.graphqlconfig` or command line.\n\nThe schema will be obtained from the `schemaPath` key, you can fetch it via `graphql get-schema`\n\nAll other options such as `csv`, `json`, `mutation` or `mapping` _can_ be placed in the `extensions.load` key\nor provided via commandline.\n\nHere is an example:\n\n`.graphqlconfig`\n```json\n{\n  \"schemaPath\": \"schema.graphql\",\n  \"includes\": [\n    \"src/**/*.graphql\",\n    \"src/**/*.gql\",\n  ],\n  \"extensions\": { \n    \"load\": { // this section is optional\n      \"csv\" : \"reviews.txt\",\n      \"mutation\": \"createReview\",\n      \"mapping\": { \"text\" : \"review\", \"rating\" : \"stars\"}\n    }\n  }\n}\n```\n\n## Usage\n\nYou can now run:\n\n```\ngraphql load\n```\n\nor\n\n```\ngraphql load --csv reviews.txt --mutation createReview2 --mapping '{ \"text\" : \"commentary\", \"rating\" : \"stars\"}'\n\nUsing endpoint starwars: http://localhost:7474/graphql/\nUsing mutation \"createReview2\".\n\nDone parsing CSV-file /Users/mh/d/js/graphql-cli-load/example/reviews.txt rows: 3\n meta: {\"delimiter\":\"\\t\",\"linebreak\":\"\\n\",\"aborted\":false,\"truncated\":false,\"cursor\":566,\"fields\":[\"episode\",\"text\",\"rating\"]}\n\nUsing mapping: {\"text\":\"commentary\",\"rating\":\"stars\"}\n\nSending query:\nmutation { \n_0 : createReview2 ( episode: NEWHOPE,commentary: \"A legendarily expansive and ambitious start to the sci-fi saga, George Lucas opened our eyes to the possibilities of blockbuster filmmaki...\n\n✔ Call succeeded:\n{\"_0\":\"Nodes created: 1\\nProperties set: 3\\nLabels added: 1\\n\",\"_1\":\"Nodes created: 1\\nProperties set: 3\\nLabels added: 1\\n\",\"_2\":\"Nodes created: 1\\nProperties set: 3\\nLabels added: 1\\n\"}...\n```\n\n## Options\n\n```\n/usr/local/bin/graphql load [--json] [--csv] [--endpoint] [--mutation] [--mapping] [--delim]\n\nOptionen:\n  --help          Hilfe anzeigen                                       [boolean]\n  --mapping, -p   name mapping of input to mutation (json)\n  --mutation, -m  mutation to call\n  --endpoint, -e  endpoint name to use\n  --json, -j      json file to load\n  --csv, -c       csv file to load\n  --delim, -d     delimiter for arrays   \n```\n\nWhich will take each line of the _csv_ or _json_ file and call the _mutation_ on the _endpoint_ with the data (optionally _mapping_ columns).\nNon-absolute files are resolved relative to the directory containing `.graphqlconfig`.\n\n\n## Test with Neo4j-GraphQL Extension\n\nTo test this with the neo4j-graphql extension:\n\n1. `npm install -g neo4j-graphql-cli`\n2. `git clone https://github.com/neo4j-graphql/graphql-cli-load \u0026\u0026 cd example`\n2. `neo4j-graphql example-schema.graphql` (remember the auth header)\n4. `npm install -g graphql-cli graphql-cli-load`\n5. Run `graphql` to install the endpoint, and **manually add the auth-header** to `.graphqlconfig`, like here:\n```\n\"endpoints\": {\n  \"starwars\": {\"url\":\"http://localhost:7474/graphql/\",\"headers\":{\"Authorization\": \"Basic bmVvNGo6dGVzdA==\"}}\n},\n```\n6. Run `graphql load --csv reviews.txt` or `graphql load --csv reviews.json`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j-graphql%2Fgraphql-cli-load","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneo4j-graphql%2Fgraphql-cli-load","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j-graphql%2Fgraphql-cli-load/lists"}