Title
j

John Smeeth

11/28/2018, 7:47 AM
error
err:  graphql: Project not found: 'go-graphql$dev'
d

divyendu

11/28/2018, 8:45 AM
Did you run
prisma deploy
command?
j

John Smeeth

11/28/2018, 9:33 AM
yes, i already run
d

divyendu

11/28/2018, 9:35 AM
Can you please share your
prisma.yml
file!
j

John Smeeth

11/28/2018, 9:38 AM
# Specifies the HTTP endpoint of your Prisma API.
endpoint: <http://localhost:4466>

# Defines your models, each model is mapped to the database as a table.
datamodel: datamodel.prisma

# Specifies the language and directory for the generated Prisma client.
generate:
  - generator: go-client
    output: ../prisma-client/

# Ensures Prisma client is re-generated after a datamodel change.
hooks:
  post-deploy:
    - prisma generate

# # Seeds initial data into the database by running a script.
# seed:
#   run: go run seed.go
Here is my prisma.yml
d

divyendu

11/28/2018, 9:40 AM
You are deploying to
<http://localhost:4466>
which means that the service and stage names would be "default" instead of "go-graphql" and "dev"
Can you please run
prisma generate
again!
Prisma endpoint has the following structure:- http://<server-url>/<service-name>/<stage-name> Service and stage names are optional and default to "default", so, http://<server-url> is a valid Prisma service endpoint and the service and stage will default to "default" and "default".
j

John Smeeth

11/28/2018, 9:43 AM
i've run
prisma generate
. but it still there
I got that error when i try to create a draft
d

divyendu

11/28/2018, 9:50 AM
Can you please create an issue here with minimal reproduction? https://github.com/prisma/prisma/issues/new?template=bug_report.md I will repro it at my end than and try to help you 🙂
j

John Smeeth

11/28/2018, 9:52 AM
Ok. thank you response
d

divyendu

11/28/2018, 9:53 AM
Please feel free to ping here or DM me once you are done creating the reproducible issue 🙂
j

John Smeeth

11/28/2018, 10:34 AM
hi @divyendu I've created two issue i faced on github. Please take a look, thank you
d

divyendu

11/28/2018, 10:50 AM
Can you please share the links here?
n

nikolasburk

11/28/2018, 12:11 PM
Hey @John Smeeth, I've updated the go/graphql example this morning. Could you check it out from scratch just using the instructions in the README and see if everything works for you now? 🙂
👍 1
🙌 1
j

John Smeeth

11/29/2018, 3:17 AM
@nikolasburk I've reclone it but i got other error. with case using demo database:
~/g/s/c/p/g/graphql> prisma deploy
? Set up a new Prisma server or deploy to an existing server? Demo server
? Choose the region of your demo server johnsmeeth0210/demo-eu1
? Choose a name for your service prisma
? Choose a name for your stage dev

Written endpoint `<https://eu1.prisma.sh/johnsmeeth0210/prisma/dev>` to prisma.yml

Creating stage dev for service prisma !

ERROR: Whoops. Looks like an internal server error. Search your server logs for request ID: eu1:cjp1wtzj6002h0a03br38qk5v

{
  "data": {
    "addProject": null
  },
  "errors": [
    {
      "message": "Whoops. Looks like an internal server error. Search your server logs for request ID: eu1:cjp1wtzj6002h0a03br38qk5v",
      "path": [
        "addProject"
      ],
      "locations": [
        {
          "line": 2,
          "column": 9
        }
      ],
      "requestId": "eu1:cjp1wtzj6002h0a03br38qk5v"
    }
  ],
  "status": 200
}
With case using local database:
018/11/29 10:14:44 Server is running on <http://localhost:4000>
Post : unsupported protocol scheme ""

goroutine 34 [running]:
runtime/debug.Stack(0x1, 0x0, 0x0)
	/usr/local/Cellar/go/1.11.2/libexec/src/runtime/debug/stack.go:24 +0xa7
runtime/debug.PrintStack()
	/usr/local/Cellar/go/1.11.2/libexec/src/runtime/debug/stack.go:16 +0x22
clones/prisma-examples/go/graphql/vendor/github.com/99designs/gqlgen/graphql.DefaultRecover(0x14ec200, 0xc000358c30, 0x140aea0, 0xc000359350, 0x0, 0x4000105)
	/Users/alex/go/src/clones/prisma-examples/go/graphql/vendor/github.com/99designs/gqlgen/graphql/recovery.go:16 +0xa7
main.(*executionContext).FieldMiddleware.func1(0xc000286d40, 0x14ec200, 0xc000358c30, 0xc000145900)
	/Users/alex/go/src/clones/prisma-examples/go/graphql/server/generated.go:2626 +0x78
panic(0x140aea0, 0xc000359350)
	/usr/local/Cellar/go/1.11.2/libexec/src/runtime/panic.go:513 +0x1b9
main.(*mutationResolver).CreateDraft(0xc0003ac068, 0x14ec200, 0xc000358c30, 0xc000382121, 0xa, 0xc000286dc0, 0xc000382156, 0xb, 0x0, 0x0, ...)
	/Users/alex/go/src/clones/prisma-examples/go/graphql/server/resolver.go:44 +0x1dc
main.(*executionContext)._Mutation_createDraft.func1(0x14ec200, 0xc000358c30, 0xc000296030, 0xc000145898, 0x20, 0xc000145890)
	/Users/alex/go/src/clones/prisma-examples/go/graphql/server/generated.go:574 +0x252
clones/prisma-examples/go/graphql/vendor/github.com/99designs/gqlgen/graphql.DefaultResolverMiddleware(0x14ec200, 0xc000358c30, 0xc0003ae300, 0x14ec200, 0xc000358c30, 0xc000145900, 0xc0003ae300)
	/Users/alex/go/src/clones/prisma-examples/go/graphql/vendor/github.com/99designs/gqlgen/graphql/context.go:35 +0x3a
main.(*executionContext).FieldMiddleware(0xc000286d40, 0x14ec200, 0xc000358c30, 0x0, 0x0, 0xc0003ae300, 0x0, 0x0)
	/Users/alex/go/src/clones/prisma-examples/go/graphql/server/generated.go:2630 +0xa1
main.(*executionContext)._Mutation_createDraft(0xc000286d40, 0x14ec200, 0xc000358b70, 0xc000283900, 0xc0003ae2e0, 0x2, 0x2, 0x1, 0xc0003ae2c0)
	/Users/alex/go/src/clones/prisma-examples/go/graphql/server/generated.go:572 +0x1fe
main.(*executionContext)._Mutation(0xc000286d40, 0x14ec200, 0xc000358b70, 0xc000286ac0, 0x1, 0x1, 0x1c02880, 0x0)
	/Users/alex/go/src/clones/prisma-examples/go/graphql/server/generated.go:509 +0x5b9
main.(*executableSchema).Mutation.func1(0x14ec200, 0xc000358b40, 0x14245c0, 0x1413701, 0xc0003ae2a0)
	/Users/alex/go/src/clones/prisma-examples/go/graphql/server/generated.go:463 +0x61
clones/prisma-examples/go/graphql/vendor/github.com/99designs/gqlgen/graphql.DefaultRequestMiddleware(0x14ec200, 0xc000358b40, 0xc0003ae2a0, 0xc000264d40, 0xc000145be0, 0x102aea2)
	/Users/alex/go/src/clones/prisma-examples/go/graphql/vendor/github.com/99designs/gqlgen/graphql/context.go:43 +0x3a
main.(*executableSchema).Mutation(0xc000160000, 0x14ec200, 0xc000358b40, 0xc00035c070, 0xc000358b40)
	/Users/alex/go/src/clones/prisma-examples/go/graphql/server/generated.go:462 +0xd8
clones/prisma-examples/go/graphql/vendor/github.com/99designs/gqlgen/handler.GraphQL.func1(0x14ebe80, 0xc0003a4000, 0xc000288800)
	/Users/alex/go/src/clones/prisma-examples/go/graphql/vendor/github.com/99designs/gqlgen/handler/graphql.go:255 +0x562
net/http.HandlerFunc.ServeHTTP(0xc00012d290, 0x14ebe80, 0xc0003a4000, 0xc000288800)
	/usr/local/Cellar/go/1.11.2/libexec/src/net/http/server.go:1964 +0x44
net/http.(*ServeMux).ServeHTTP(0x17c3e40, 0x14ebe80, 0xc0003a4000, 0xc000288800)
	/usr/local/Cellar/go/1.11.2/libexec/src/net/http/server.go:2361 +0x127
net/http.serverHandler.ServeHTTP(0xc00013e5b0, 0x14ebe80, 0xc0003a4000, 0xc000288800)
	/usr/local/Cellar/go/1.11.2/libexec/src/net/http/server.go:2741 +0xab
net/http.(*conn).serve(0xc0001600a0, 0x14ec140, 0xc0000b4240)
	/usr/local/Cellar/go/1.11.2/libexec/src/net/http/server.go:1847 +0x646
created by net/http.(*Server).Serve
	/usr/local/Cellar/go/1.11.2/libexec/src/net/http/server.go:2851 +0x2f5
this is the log when i run
prisma deploy
~/g/s/c/p/g/graphql > prisma deploy
Creating stage default for service default ✔
Deploying service `default` to stage `default` to server `local` 447ms

Changes:

  User (Type)
  + Created type `User`
  + Created field `id` of type `GraphQLID!`
  + Created field `email` of type `String!`
  + Created field `name` of type `String`
  + Created field `posts` of type `[Relation!]!`
  + Created field `updatedAt` of type `DateTime!`
  + Created field `createdAt` of type `DateTime!`

  Post (Type)
  + Created type `Post`
  + Created field `id` of type `GraphQLID!`
  + Created field `createdAt` of type `DateTime!`
  + Created field `updatedAt` of type `DateTime!`
  + Created field `published` of type `Boolean!`
  + Created field `title` of type `String!`
  + Created field `content` of type `String`
  + Created field `author` of type `Relation!`

  PostToUser (Relation)
  + Created relation between Post and User

Applying changes 1.1s

Hooks:
Seeding based on seed.graphql 1.0s

Your Prisma GraphQL database endpoint is live:

  HTTP:  <http://localhost:4466>
  WS:    <ws://localhost:4466>


post-deploy:

Generating schema... 22ms

Running prisma generate...
Saving Prisma Client (Go) at /Users/alex/go/src/clones/prisma-examples/go/graphql/prisma-client/
Running prisma generate ✔
I'm really want to using Go but it seem not stable as Node. What is your advise? Thank you
n

nikolasburk

11/29/2018, 8:57 AM
Hmm not sure what the issue was on your first deploy when you tried the Demo server, this was an internal server error that we'll investigate. However, if you retry that deploy to a demo server it should work. The error about the
Post : unsupported protocol scheme ""
is there because the
DefaultEndpoint
has not been set in the generated
prisma-client/prisma.go
file. You should be able to fix this by running
prisma generate
(but ensure that
prisma deploy
has been performed successfully before and the
endpoint
in your
prisma.yml
is set). When running
prisma generate
, the CLI checks your
prisma.yml
and sets the
endpoint
from it as the
DefaultEndpoint
in the generated
prisma-client/prisma.go
.
👍 1