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

    hinsxd

    10/23/2018, 12:33 PM
    However the built-in graphql api
    where:{ title_contains }
    does not provide case-insensitive search, and I cant perform raw sql queries with Client neither.
    🔥 1
  • h

    hinsxd

    10/23/2018, 12:34 PM
    So, how do you guys implement search with prisma client?
  • w

    White

    10/23/2018, 1:41 PM
    Hi, we're having problems trying to change a database password on one of our servers. The issue is that we don't know where/what the current MySQL password that was set at the time. We can easily change our password on our end, but how do we modify the database password on prisma? This is currently giving us issues, and it's quite painful.
    e
    • 2
    • 1
  • r

    Rick Perko

    10/23/2018, 1:53 PM
    Hi Everyone, we are a North Carolina company, called ScoreShots. We are on a paid tier but having a devil of a time getting any reply from technical support. Does anyone have any advice for how to contact support? Many thanks, y'all.
    e
    • 2
    • 1
  • a

    adroaldof

    10/23/2018, 5:29 PM
    Hi guys. I’ve searched something about import types from
    .graphql
    files. I’ve found [graphql-import](https://github.com/prisma/graphql-import) to import using
    # import something from 'something-else'
    . This works fine between
    .graphql
    files. But what I’m trying to do is to import some
    types
    from
    generated.graphql
    from Prisma into a
    .js
    file. For example: I have this
    generated.graphql
    file from Prisma
    Copy code
    graphql
    """generated.graphql file"""
    type ItemWhereInput { ... }
    
    type ItemConnection { ... }
    
    ...
    I would like to import some types from
    generated.graphql
    file to
    items-types.js
    file
    Copy code
    javascript
    // items-types.js file
    
    import gql from 'graphql-tag';
    // I would like to make some kind of import ItemWhereInput and ItemConnection here
    // Something like `import { ItemWhereInput, ItemConnection } from 'generated.graphql'`
    
    ... 
    
    const ItemWhereUniqueInput = gql`
      input ItemWhereUniqueInput {
        id: String!
      }
    `;
    
    ... 
    
    // And export ItemWhereInput and ItemConnection here
    export default [Item, ItemInput, ItemWhereUniqueInput, ItemUpdateInput];
    That way I could call
    makeExecutableSchema
    from
    graphql-tools
    and use those types in some place else
    Copy code
    javascript
    // items-query.js file
    
    import { forwardTo } from 'prisma-binding';
    
    const schema = `
      items: [Item]!
      item (where: ItemWhereUniqueInput!): Item
      
      # And use it here
      itemsConnection (where: ItemWhereInput): ItemConnection!
    `;
    
    const resolvers = {
      items: forwardTo('db'),
      item: forwardTo('db'),
      itemsConnection: forwardTo('db'),
    };
    
    export default {
      schema,
      resolvers,
    };
    If it is somewhere else or there are something that could help, please, point me out. Thanks ahead
    f
    • 2
    • 5
  • j

    Joseph Carrington

    10/23/2018, 7:55 PM
    I really wish Prisma CLI would stop getting stuck on applying change 2 of 1
    y
    • 2
    • 3
  • j

    Joseph Carrington

    10/23/2018, 7:56 PM
    Like… of course you cannot apply the second change of a set of one change, and yet:
    Copy code
    Changes:
    
      PortalCart (Type)
      ~ Updated field `owner`
    
    Applying changes (2/1) ⣯
    n
    • 2
    • 4
  • d

    dieff

    10/23/2018, 8:27 PM
    Hi all, I think I have found a bug in the Typescript client, but wanted to ask here if I am doing things right before I go to the trouble of opening an issue. I have the code here:``` notifications: { subscribe: async (root, args, context: IntResolverContext, info): Promise<AsyncIterator<Notification>> => { const { db, id } = context; return db.$subscribe.notification({ where: { AND: [ { mutation_in: ["CREATED"] }, // the notification was just created, rather than updated or deleted { node: { user: { id, // filter for notifications where the user has the current id }, }, }, ], }, // typescript seems to be broken here 😠 } as any).node(); }, },
    Copy code
    If I don't cast the argument `any` then I get the error ```Argument of type '{ where: { AND: ({ mutation_in: string[]; } | { node: { user: { id: string; }; }; })[]; }; }' is not assignable to parameter of type 'NotificationSubscriptionWhereInput'.
      Object literal may only specify known properties, and 'where' does not exist in type 'NotificationSubscriptionWhereInput'
    The code works as it is now even with the error. If I take away the
    where
    property, and just make the
    AND
    as the first key then I get no typescript error but the code will not work. Maybe the generated types are incorrect? Also possible I'm just using the library wrong.
    n
    • 2
    • 2
  • s

    shadowcodex

    10/23/2018, 10:03 PM
    anyone know why when deploying to an existing schema, prisma responds that it did the migration, but it’s schema didn’t change?
  • s

    shadowcodex

    10/23/2018, 10:42 PM
    Can confirm that logs in prisma cluster say it happened, and mysql is updated.
  • s

    shadowcodex

    10/23/2018, 10:42 PM
    Just the responding prisma schema is wrong
  • s

    shadowcodex

    10/23/2018, 10:50 PM
    after a cluster restart it came up
  • s

    shadowcodex

    10/24/2018, 12:19 AM
    Ahh we had a rabbitmq failure, that was causing schema not to propagate across cluster
    n
    • 2
    • 1
  • e

    Elfayer

    10/24/2018, 6:23 AM
    Hi, where should we ask questions?
    e
    • 2
    • 1
  • e

    Elfayer

    10/24/2018, 6:23 AM
    Coming from discord...
  • h

    Hays Clark

    10/24/2018, 7:15 AM
    Any one know if you can set the
    Copy code
    createdAt: DateTime!
    and
    Copy code
    updatedAt: DateTime!
    values by Seeding or Import your data? I’m trying to write a parser that is importing data from other data sources and it would be nice not to have to make a ‘created_at’, and ‘updated_at’ property…
    s
    n
    • 3
    • 2
  • d

    doums

    10/24/2018, 9:10 AM
    Hi all, with prisma client, how to return the entire SubscriptionPayload by example
    Copy code
    type PostSubscriptionPayload {
      mutation: MutationType!
      node: Post
      updatedFields: [String!]
      previousValues: PostPreviousValues
    }
    from one subscription like
    Copy code
    type Subscription {
      posts: PostSubscriptionPayload
    }
    ? I tried this:
    Copy code
    posts: {
        subscribe: async (parent, args, ctx) => {
          return ctx.prisma.$<http://subscribe.post|subscribe.post>()
        },
        resolve: payload => {
          console.log(payload)
          return payload
        }
      }
    But in the resolve function I receive only the mutation Type, all others fields are null, whatever is the mutation type.
    n
    • 2
    • 5
  • n

    nuno

    10/24/2018, 9:37 AM
    In prisma.yml, when we do "${env:PRISMA_ENDPOINT}", where does that syntax come from? What parses the ${env:something} and what else can we do with it?
    n
    • 2
    • 4
  • m

    mezie

    10/24/2018, 10:06 AM
    Is it possible to migrate an existing database to Prisma cloud?
    n
    • 2
    • 2
  • t

    Thanos

    10/24/2018, 10:06 AM
    Hi all, I'd like to ask you guys if you know how to disable logs on graphql-yoga on production. I'm talking about this kind of logs. I tried
    debug:false
    on server options but it didn't have any effect. Thank you.
    n
    • 2
    • 3
  • p

    Pieter

    10/24/2018, 10:31 AM
    Hi, not sure if this is the correct channel to discuss this, but I am having issues with typegql
  • p

    Pieter

    10/24/2018, 10:32 AM
    despite decorating
    @InputField{isNullable:true})
    my mutation still expects all params as required.
  • p

    Pieter

    10/24/2018, 10:33 AM
    I set the
    ?
    optional type on typescript but still does not work
    n
    • 2
    • 7
  • y

    Yash Rathore

    10/24/2018, 11:46 AM
    hello everyone, I have graphql schema type of User in which I have a field of follower , in which I want to define a list of User types . when I am doing this and deploy to prisma , it showing me other possible type and none of which are working and showing error
    n
    • 2
    • 2
  • y

    Yash Rathore

    10/24/2018, 11:49 AM
    if wrong how to define a field which return list of its parent Type
    is_it_a_valid_schema_type.js
  • t

    theom

    10/24/2018, 12:31 PM
    So I'm getting an
    You must wrap the query string in a "gql" tag.
    error when calling refreshQueries. What am I overlooking here? pagination.js
    Copy code
    const PAGINATION_QUERY = gql`
        query PAGINATION_QUERY {
            itemsConnection {
                aggregate {
                    count
                }
            }
        }
    `;
    
    export { PAGINATION_QUERY };
    createItem.js
    Copy code
    import deleteItemsFromCache from '../utils/deleteItemsFromCache';
    import PAGINATION_QUERY from './Pagination';
    
    update = (cache, payload) => {
        deleteItemsFromCache
    };
    
    <Mutation 
        mutation={CREATE_ITEM_MUTATION} 
        variables={this.state}
        update={this.update}
        refetchQueries={[{ query: PAGINATION_QUERY }]}
    >
    a
    • 2
    • 2
  • w

    wontwon

    10/24/2018, 3:24 PM
    Hi guys, so i’m just trying to play around with Heroku deployment by seeing if i can deploy one of the example applications specifically node-graphql-auth.
    n
    j
    • 3
    • 22
  • d

    doums

    10/24/2018, 6:08 PM
    I really think there is a big problem with prisma client and subscription: First problem I notice is there is actually no way to return directly the full subscription payload like
    Copy code
    type PostSubscriptionPayload {
      mutation: MutationType!
      node: Post
      updatedFields: [String!]
      previousValues: PostPreviousValues
    }
    Because when I try with something like that in the resolver
    return ...prisma.$<http://subscribe.post|subscribe.post>()
    and I console log the returned payload of this, I get
    PostSubscriptionPayload
    but only
    updatedFields
    and
    mutation
    fields are set correctly, the other fields remains null, whatever is the event (creation, delete, update). Second problem, and this is a big one because it concerns the DELETE subscription, we can't get back the previous value of the deleted node at all! If I try
    ctx.prisma.$<http://subscribe.post|subscribe.post>({ mutation_in: ['DELETED'] }).previousValues()
    with
    Copy code
    type Subscription {
      deletedPost: PostPreviousValues! // I tested with Post! too, same error
    }
    I get
    null
    Note that I console log the payload in the
    resolve
    function of each subscription resolver like
    Copy code
    deletedPost: {
        subscribe: async (parent, args, ctx) => {
          return ctx.prisma.$<http://subscribe.post|subscribe.post>({ mutation_in: ['DELETED'] }).previousValues()
        },
        resolve: payload => {
          console.log(payload)
          return payload
        }
      }
    So I'm pretty sure the problem comes from prisma Client 🤪 prisma 1.19 (docker image as well)
  • g

    Guus

    10/24/2018, 8:50 PM
    Hi guys, I've set-up a GraphQL Server using Prisma, graphql-yoga and some other packages. Now I wish to start using the api in a client application. Is there any plugin/method to have autocompletion/validation in VSCode when writing queries / mutations within the gql`...` tags based on the graphql schema?
    h
    j
    n
    • 4
    • 8
  • r

    Ramm

    10/24/2018, 10:32 PM
    Hi, Im trying to deploy prisma server on aws fargate ( following this tutorial: https://www.prisma.io/docs/tutorials/deploy-prisma-servers/aws-fargate-joofei3ahd/#2.-deploying-a-prisma-server-to-fargate ) but when trying to deploy AWS Fargate Prisma stack. I keep getting the following error: Unable to assume the service linked role. Please verify that the ECS service linked role exists. (Service: AmazonECS; Status Code: 400; Error Code: InvalidParameterException; Any suggestions? Thanks
    n
    • 2
    • 3
1...139140141...637Latest