Skip to content

Gave it a (unsuccessful) try #6

@idkjs

Description

@idkjs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions