Git Product home page Git Product logo

graphql-cli-load's Issues

Gave it a (unsuccessful) try

macOS Sierra

Node 9.

i ran graphql init and to get .graphqlconfig:

$ graphql init
? Local schema file path: schema.graphql
? Endpoint URL (Enter to skip): https://api.graph.cool/relay
/v1/cj9o4se940gsu0148s5a4helr
? Name of this endpoint, for e.g. default, dev, prod: server


? Subscription URL (Enter to skip):
? Do you want to add other endpoints? No
? What format do you want to save your config in? JSON

About to write to /Users/shingdev/code/GRAPHCOOL/react-graphql/quickstart-with-relay-modern/.graphqlconfig:

{
  "schemaPath": "schema.graphql",
  "extensions": {
    "endpoints": {
      "server": "https://api.graph.cool/relay/v1/cj9o4se940gsu0148s5a4helr"
    }
  }
}

? Is this ok? Yes```

then ran graphql get-schema, which saw no changes with the previously existing schema.graphql file which seemed correct.

$ graphql get-schema
Downloading introspection from https://api.graph.cool/relay/v1/cj9o4se940gsu0148s5a4helr
No changes


I then ran graphql load which failed with this json file [https://gist.github.com/idkjs/06d10b7a02edb8e6a2b10cb4608bdaa4] :

$ graphql load -m createCompany --json companies.json
Using endpoint server: undefined
Using mutation "createCompany": "".
Done parsing JSON-file /Users/shingdev/code/GRAPHCOOL/react-graphql/quickstart-with-relay-modern/companies.json rows: 90
Sending query:
mutation {

}...

Parameter "url" must be a string, not undefined

I changed the endpoint in graphconfig to this:


{
"schemaPath": "schema.graphql",
"extensions": {
"endpoints": {
"server": {"url":"https://api.graph.cool/relay/v1/cj9o4se940gsu0148s5a4helr"}
}
}
}


Which produced this error:

```sh
GraphQL Error (Code: 200): {"response":{"error":"Syntax error while parsing GraphQL query. Invalid input \"mutation { \\n\\n}\", expected OperationDefinition, FragmentDefinition or TypeSystemDefinition (line 1, column 1):\nmutation { \n^","status":200},"request":{"query":"mutation { \n\n}","variables":{}}}

This is my graphcool playground mutation def:

screen shot 2017-11-06 at 13 51 14

This is what the mutation looks like in DevTools if I do one manually

-mutation & variables

mutation CreateCompanyMutation(
  $input: CreateCompanyInput!
) {
  createCompany(input: $input) {
    company {
      id
      description
      logo
    }
  }
}
  • variables
{
    "input": {
        "description": "testatt",
        "logo": "https://d25e16a427ed3ce77d27-76b466cd72f6b3a6e7219a8a02851d8e.ssl.cf1.rackcdn.com/files/59382428ff3935425ca91516/size_5_1001pharmaciesjpg.jpg",
        "clientMutationId": ""
    }
}

Any ideas? Thank you.

Loading json data

I'm trying to load data from a json file, when executing the graphql load command I get the following complains:

Sending query: mutation { _0 : createBlabla ( blabla1: 123,blabla2: "blabla2", blabla3: "blabla3 ) { blabla } _1 : ... }... Field "blabla" of type "BlablaType" must have a sub selection.:

If I execute the same mutation from that output in graphql, blabla will expand to blabla { id } and data is successfully added.

P.S. I got the server schema via graphql get-schema

Syntax Error: Expected Name, found }

Hello jexp, first thanks for the project, it looks very useful.

I'm having a problem when running the grapqhl load that maybe you would know what it would mean.

Using endpoint local: {"url":"http://localhost:4000"}
Using mutation "post": "".
Done parsing CSV-file /Users/Me/Desktop/devtest/hackernews-node/reviews.txt rows: 3
 meta: {"delimiter":"\t","linebreak":"\n","aborted":false,"truncated":false,"cursor":571,"fields":["episode","commentary","stars"]}
Using mapping: {"description":"commentary","url":"stars"}
Sending query:
mutation { 

}...
✖ 
Syntax Error: Expected Name, found }: {"response":{"errors":[{"message":"Syntax Error: Expected Name, found }","locations":[{"line":3,"column":1}]}],"status":400},"request":{"query":"mutation { \n\n}","variables":{}}}

I'm running the database API with prisma, and I have uploaded my whole minimum viable test project to get this functionality working in this repository: https://github.com/daquintero/testGraphqlCLILoad/tree/master

I'm not sure if this is enough information for the question, but please tell me if you need anything else. I appreciate very much the help!

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.