https://www.prisma.io/ logo
Join Slack
Powered by
# orm-help
  • w

    wesbos

    05/10/2018, 3:16 PM
    you need an array if you care about order
  • p

    pettanko

    05/10/2018, 3:17 PM
    Im trying to write new data to apollo cache, on mutation update. It worked fine with concat() until I switched to using Prisma. Now new data just ends up behind everything else, so its in bottom of my page. Any tips on that? 😛
  • h

    harmony

    05/10/2018, 3:21 PM
    sort before displaying?
  • w

    wesbos

    05/10/2018, 3:21 PM
    well concat was from an array, and then object.assign is for an object, so maybe you need to change your data structure to an array?
  • d

    drk

    05/10/2018, 4:59 PM
    kinda lost in migrating to 1.8… is
    endpoint: <https://eu1.prisma.sh/${env:PRISMA_CLUSTER}/${env:PRISMA_STAGE}>
    valid in prisma.yml or should i go w/ the defaults and use
    <https://eu1.prisma.sh/>
    n
    • 2
    • 1
  • p

    picosam

    05/10/2018, 5:19 PM
    Hello, anyone came across this after upgrading to 1.8 and using postgres:
    Copy code
    Exception in thread "main" java.lang.RuntimeException: Unable to load Prisma config: com.prisma.config.InvalidConfiguration: Expected hash under 'databases' to be non-empty
    at scala.sys.package$.error(package.scala:27)
    at com.prisma.config.ConfigLoader$.load(ConfigLoader.scala:38)
    at com.prisma.local.PrismaLocalDependencies.<init>(PrismaLocalDependencies.scala:39)
    at com.prisma.local.PrismaLocalMain$.delayedEndpoint$com$prisma$local$PrismaLocalMain$1(PrismaLocalMain.scala:15)
    at com.prisma.local.PrismaLocalMain$delayedInit$body.apply(PrismaLocalMain.scala:12)
    at scala.Function0.apply$mcV$sp(Function0.scala:34)
    at scala.Function0.apply$mcV$sp$(Function0.scala:34)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
    at scala.App.$anonfun$main$1$adapted(App.scala:76)
    at scala.collection.immutable.List.foreach(List.scala:389)
    at scala.App.main(App.scala:76)
    at scala.App.main$(App.scala:74)
    at com.prisma.local.PrismaLocalMain$.main(PrismaLocalMain.scala:12)
    at com.prisma.local.PrismaLocalMain.main(PrismaLocalMain.scala)
    I seem to have found a similar issue on the forums but with no answer really. @nilan do you happen to have a clue?
    n
    • 2
    • 46
  • b

    bobbyt

    05/10/2018, 5:44 PM
    Does anyone know how long Graphcool (legacy) tokens last? Have run into an issue where it seems they are expiring before Auth0 tokens. Searched documentation and forums and can't find anything. Thanks!
  • t

    tomhut

    05/10/2018, 5:53 PM
    @bobbyt I think it is 30 days
  • b

    bobbyt

    05/10/2018, 6:08 PM
    @tomh Ok thanks! Do you know if this is documented anywhere?
    n
    l
    • 3
    • 12
  • h

    Horacio

    05/10/2018, 7:32 PM
    Hello, I'm trying to do my first deploy with Prisma by following the node.js tutorial, however, when I type "prisma deploy" I get the following error:
    Copy code
    ✔ ⮀ …/database ⮀ @master ● ? ⍟2 ⮀ prisma deploy
      config CWD /Users/horacio.gutierrez/FullstackAcademy/1802-FSA-RM-Library/GraphQL/hackernews-node/database +0ms
      config HOME /Users/horacio.gutierrez +2ms
      config definitionDir /Users/horacio.gutierrez/FullstackAcademy/1802-FSA-RM-Library/GraphQL/hackernews-node/database +0ms
      config definitionPath /Users/horacio.gutierrez/FullstackAcademy/1802-FSA-RM-Library/GraphQL/hackernews-node/database/prisma.yml +0ms
      cli { isGlobal: true } +0ms
      StatusChecker setting status checker +0ms
      cli command id deploy +4ms
      cli:plugincache Got plugin from cache +0ms
      cli:plugincache /Users/horacio.gutierrez/Library/Caches/prisma/plugins.json +1ms
      cli:plugincache Got plugin from cache +1ms
      cli:plugincache /Users/horacio.gutierrez/Library/Caches/prisma/plugins.json +0ms
      plugins findCommand prisma-cli-core +0ms
      plugin requiring command +0ms
      cli-engine:plugins:manager requiring /usr/local/lib/node_modules/prisma/node_modules/prisma-cli-core +0ms
      portfinder:defaultHosts exports._defaultHosts is: [ '0.0.0.0', '127.0.0.1', '::1', 'fe80::1', 'fe80::1402:f497:2c57:7c56', '10.0.4.8', 'fe80::ecac:d9ff:fe52:1d6f', 'fe80::3260:347b:fdb:1739', 'fe80::bf49:86c3:bdd:693c', 'fe80::5c48:c0b5:f1da:536f', 'fe80::aede:48ff:fe00:1122' ] +0ms
      cli-engine:plugins:manager required +602ms
      plugin required command +604ms
      StatusChecker setting status checker +654ms
    TypeError: Cannot read property 'custom' of undefined
        at Object.<anonymous> (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/src/yaml.ts:35:21)
        at step (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/dist/yaml.js:40:23)
        at Object.next (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/dist/yaml.js:21:53)
        at fulfilled (/usr/local/lib/node_modules/prisma/node_modules/prisma-yml/dist/yaml.js:12:58)
        at <anonymous>
    Exiting with code: 1
  • h

    Horacio

    05/10/2018, 7:33 PM
    any ideas? thanks in advance
  • k

    Kumar

    05/10/2018, 7:36 PM
    Hi,I am looking to connect graphql API through SAP ECC, can anyone help in the required step to do this
  • t

    tz

    05/10/2018, 9:34 PM
    just upgraded to
    prisma-binding 2.0
    , got a problem: when I do
    ctx.db.exists.User({ email: <mailto:test@test.com|test@test.com> })
    , it returns all the users in the database.
  • t

    tz

    05/10/2018, 9:34 PM
    did anyone encounter this?
  • j

    jakethrog

    05/10/2018, 10:47 PM
    Trying to deploy to a new service and I get the following error during the “prisma deploy”: Error: String: 8: Expecting close brace } or a comma, got ‘!’ (Reserved character ‘!’ is not allowed outside quotes) (if you intended ‘!’ (Reserved character ‘!’ is not allowed outside quotes) to be part of a key or string value, try enclosing the key or value in double quotes, or you may be able to rename the file .properties rather than .conf): {“response”{“errors”[{“message”“String 8: Expecting close brace } or a comma, got ‘!’ (Reserved character ‘!’ is not allowed outside quotes) (if you intended ‘!’ (Reserved character ‘!’ is not allowed outside quotes) to be part of a key or string value, try enclosing the key or value in double quotes, or you may be able to rename the file .properties rather than .conf)“,”requestId”“qa oce tonyapicjh1498bv1zul0901bjdgj1n3”}],“status”500},“request”{“query”“mutation {\n\tcreateUser(data: {\n\t\temail: \“admin@admin.com\“\n\t\tpassword: \“$2a$10$9aF6EIJ1unG12zbKsm7kVe4y0cQwbsfxijRSqoetY2Z9A2oY7eAPy\” #password=admin\n\t\tfirstName: \“Inxeption\“,\n\t\tlastName: \“Admin\“,\n\t\tuserManager: true\n\t}) {\n\t\tid\n }\n}“}} at GraphQLClient.<anonymous> (/usr/local/lib/node_modules/prisma/node_modules/graphql-request/src/index.ts7213) at step (/usr/local/lib/node_modules/prisma/node_modules/graphql-request/dist/src/index.js4023) at Object.next (/usr/local/lib/node_modules/prisma/node_modules/graphql-request/dist/src/index.js2153) at fulfilled (/usr/local/lib/node_modules/prisma/node_modules/graphql-request/dist/src/index.js1258) at <anonymous> at process._tickDomainCallback (internal/process/next_tick.js2287) Exiting with code: 1
    • 1
    • 1
  • r

    ryanmagoon

    05/11/2018, 1:09 AM
    Hello all, I’m having a problem with my apollo client refetching all my queries on
    resetStore()
    before my auth token has a chance to update on login. I imagine this is a common problem if I do a
    setTimeout
    wrapping around
    resetStore
    after the login for a second or so I get my app to kick me to the home screen after login, but without it I just stay on the login screen and I only get to the home screen after a refresh when it then picks up the token (I’m on react native) is there a common pattern for dealing with this?
    m
    • 2
    • 9
  • m

    mrboutte

    05/11/2018, 1:30 AM
    so if I run
    prisma init
    which then generates
    .graphqlconfig.yml
    ,
    datamodel.graphql
    , and
    prisma.yml
    . What are my options for adding a new resolver?
  • r

    ryanmagoon

    05/11/2018, 1:34 AM
    Copy code
    const { GraphQLServer } = require('graphql-yoga')
    const { Prisma } = require('prisma-binding')
    const { ApolloEngine } = require('apollo-engine')
    const resolvers = require('./resolvers')
    
    const db = new Prisma({
      typeDefs: 'src/generated/prisma.graphql', // the auto-generated GraphQL schema of the Prisma API
      endpoint: process.env.PRISMA_ENDPOINT, // the endpoint of the Prisma API (value set in `.env`)
      debug: true // log all GraphQL queries & mutations sent to the Prisma API
      // secret: process.env.PRISMA_SECRET, // only needed if specified in `database/prisma.yml` (value set in `.env`)
    })
    
    const server = new GraphQLServer({
      typeDefs: './src/schema.graphql',
      resolvers,
      context: req => ({ ...req, db })
    })
  • r

    ryanmagoon

    05/11/2018, 1:34 AM
    @mrboutte point to some files and start writing resolvers
  • m

    mrboutte

    05/11/2018, 1:35 AM
    I’ve tried that and I keep getting
    Copy code
    Error: Directive unique: Couldn't find type unique in any of the schemas.
  • o

    Otto Jongerius

    05/11/2018, 1:36 AM
    Hey there. I' wondering about https://github.com/graphcool/serverless-plugin-typescript there are about 12 PRs outstanding but looking at the age of those PRs and lack of feedback it looks dead sadparrot What's the vision here? Discontinued? Looking for maintainers?
    n
    • 2
    • 1
  • m

    mrboutte

    05/11/2018, 1:37 AM
    Copy code
    const { GraphQLServer } = require('graphql-yoga');
    const { importSchema } = require('graphql-import');
    const { ApolloEngine } = require('apollo-engine');
    const { Prisma } = require('prisma-binding');
    
    const server = new GraphQLServer({
      typeDefs: importSchema('./datamodel.graphql'),
      context: req => ({
        ...req,
        db: new Prisma({
          endpoint: process.env.PRISMA_ENDPOINT,
          debug: true,
        }),
      }),
    });
    
    const port = parseInt(process.env.PORT, 10) || 4000;
    
    if (process.env.ENGINE_API_KEY) {
      const engine = new ApolloEngine({
        apiKey: process.env.ENGINE_API_KEY,
      });
    
      const httpServer = server.createHttpServer({
        tracing: true,
        cacheControl: true,
      });
    
      engine.on('error', err => {
        console.log('There was an error starting the server or Engine.');
        console.error(err);
    
        // The app failed to start, should probably kill the server
        process.exit(1);
      });
    
      engine.listen({ port, httpServer, graphqlPaths: ['/'] }, () =>
        console.log(
          `Server with Apollo Engine is running on <http://localhost:${port}>`,
        ),
      );
    } else {
      server.start({ port }, () =>
        console.log(`Server is running on <http://localhost:${port}`>),
      );
    }
  • r

    ryanmagoon

    05/11/2018, 1:37 AM
    sounds like a problem with one of your schemas
  • r

    ryanmagoon

    05/11/2018, 1:38 AM
    did you add
    @unique
    to one of your types in the
    schema.graphql
    ?
  • m

    mrboutte

    05/11/2018, 1:38 AM
    yeah
  • r

    ryanmagoon

    05/11/2018, 1:38 AM
    I think you can only do it in
    datamodel.graphql
  • m

    mrboutte

    05/11/2018, 1:38 AM
    the `id`’s
  • r

    ryanmagoon

    05/11/2018, 1:38 AM
    You only need the decorator in the datamodel
  • r

    ryanmagoon

    05/11/2018, 1:39 AM
    @unique
    is a special prisma thing
  • m

    mrboutte

    05/11/2018, 1:39 AM
    oh snap… I’m trying to feed through the datamodel
1...252627...637Latest