https://www.prisma.io/ logo
Join Slack
Powered by
# prisma-whats-new
  • a

    anton-b

    03/14/2018, 10:55 PM
    I am getting the
    Your token is invalid. It might have expired or you might be using a token from a different project
    - error. I have run the
    prisma token
    command, but what exactly do I need to do with it? I have my graphql server running in it's own project and the database service in another.
    n
    • 2
    • 21
  • d

    danielvdm

    03/14/2018, 11:17 PM
    whats the correct way to implement fields like userId to be generated by the auth header
  • d

    danielvdm

    03/14/2018, 11:17 PM
    e.g.
  • d

    danielvdm

    03/14/2018, 11:17 PM
    a Post has a User one to one relation
  • d

    danielvdm

    03/14/2018, 11:17 PM
    i don't want to specify the userId on the client side for obvious security reasons
  • k

    kieve

    03/14/2018, 11:17 PM
    Hi, I'm planning to integrate prisma server with Algolia service, so will listen to server side subscription for changes. But the subscription seem design for webhook only, is there a way to listen locally and call Algolia manually. Am I heading correct dirrection?
    l
    s
    • 3
    • 2
  • d

    danielvdm

    03/14/2018, 11:18 PM
    do I use a pre hook or a custom resolver?
    l
    • 2
    • 8
  • j

    Jonathan Romano

    03/15/2018, 12:30 AM
    There doesn't happen to be a "connect or create" option does there?
    h
    • 2
    • 1
  • g

    glen

    03/15/2018, 1:28 AM
    anyone know of any examples of using webtask cron with graphcool? Mostly looking into how I can authenticate the webtask to execute some resolvers.
  • r

    rcy

    03/15/2018, 5:49 AM
    is
    _QueryMeta
    something that exists in prisma? I am porting over some work from graphcool framework and came across this used to get a count of number of records in a model. I can't find anything in my generated schema in prisma though.
    • 1
    • 2
  • a

    Antonio

    03/15/2018, 8:54 AM
    Hi!
  • a

    Antonio

    03/15/2018, 8:55 AM
    could someone give me some help with this issue? I am stuck for days with it 🙂 https://www.graph.cool/forum/t/graphql-error-cannot-query-field-authenticateuser-on-type-mutation/2820
  • s

    sakhmedbayev

    03/15/2018, 9:14 AM
    can I use
    graphcool add-template messaging/mailgun
    with Prisma?
    c
    n
    • 3
    • 14
  • a

    Akshay

    03/15/2018, 9:47 AM
    can we store multidimensional arrays in graphcool? like square[][]
    n
    • 2
    • 6
  • m

    michieldewilde

    03/15/2018, 11:28 AM
    Hey everybody. I got a question. I have a query that fetches a list of items from prisma. After that I run a delete mutation that removes an item from that list. When I reload the webpage, I get the same list of items back with the deleted item included. In the playground the same query gives me the list of items without the deleted item. Is there some kind of caching in prisma?
    n
    • 2
    • 10
  • p

    piscis

    03/15/2018, 11:47 AM
    Hi, is there a way to disable introspection queries in prisma?
    n
    • 2
    • 10
  • j

    johhansantana

    03/15/2018, 2:43 PM
    could someone update on the release for this PR? https://github.com/graphcool/prisma/pull/2092
    n
    • 2
    • 4
  • v

    Vendicto

    03/15/2018, 2:44 PM
    Hi there what should I do to skip some field If they are empty
    Copy code
    export const UPDATE_USER_MUTATION = gql`
        mutation updateUser(
        $id : ID!,
        $fullName: String!,
        $username: String!,
        $avatarId: ID!,
        $email: String!
        ){
            updateUser(
                id: $id,
                fullName: $fullName,
                username: $username,
                avatarId: $avatarId,
                email: $email
            ){
                id
                fullName
                username
                avatar{
                    url
                }
                email
                age
            }
        }
    `;
    And when I update fields without file ID, I got an error GraphQL error: Variable '$avatarId' expected value of type 'ID!' but value is undefined. Reason: Expected non-null value, found null. (line 1, column 71): mutation updateUser($id: ID!, $fullName: String!, $username: String!, $avatarId: ID!, $email: String!)
    m
    • 2
    • 3
  • p

    peter

    03/15/2018, 3:01 PM
    is it possible to disable
    graphql-playground
    and instead explicitly use regular
    graphiql
    ?
  • m

    manticarodrigo

    03/15/2018, 3:44 PM
    I have a feed query that returns all posts. Without a constructor, it returns my posts. When I add an
    orderBy
    filter in the constructor I get a 400 response. In my prisma schema it doesn’t have a constructor because it just returns all posts. How can I achieve this
    orderBy
    filter?
    Prisma_Feed_Query.txt
  • p

    picosam

    03/15/2018, 3:45 PM
    Hello, after upgrading to
    graphql-yoga 1.6.0
    I’m suddenly getting this when starting the server:
    Copy code
    Error: SchemaDirectiveVisitor for @isAuthenticated must implement visitQuery method
        at /Users/Sammy/Projects/mblt-gql/node_modules/graphql-yoga/node_modules/graphql-tools/src/schemaVisitor.ts:650:17
        at /Users/Sammy/Projects/mblt-gql/node_modules/graphql-yoga/node_modules/graphql-tools/src/schemaVisitor.ts:692:5
        at Array.forEach (<anonymous>)
        at each (/Users/Sammy/Projects/mblt-gql/node_modules/graphql-yoga/node_modules/graphql-tools/src/schemaVisitor.ts:691:30)
        at /Users/Sammy/Projects/mblt-gql/node_modules/graphql-yoga/node_modules/graphql-tools/src/schemaVisitor.ts:643:7
        at /Users/Sammy/Projects/mblt-gql/node_modules/graphql-yoga/node_modules/graphql-tools/src/schemaVisitor.ts:692:5
        at Array.forEach (<anonymous>)
        at each (/Users/Sammy/Projects/mblt-gql/node_modules/graphql-yoga/node_modules/graphql-tools/src/schemaVisitor.ts:691:30)
        at Function.SchemaDirectiveVisitor.getDeclaredDirectives (/Users/Sammy/Projects/mblt-gql/node_modules/graphql-yoga/node_modules/graphql-tools/src/schemaVisitor.ts:633:5)
        at Function.SchemaDirectiveVisitor.visitSchemaDirectives (/Users/Sammy/Projects/mblt-gql/node_modules/graphql-yoga/node_modules/graphql-tools/src/schemaVisitor.ts:523:12)
    [nodemon] app crashed - waiting for file changes before starting...
    Was there a breaking change documented somewhere?
    👀 1
    m
    • 2
    • 2
  • m

    martin

    03/15/2018, 4:02 PM
    Hi guys, we noticed a differents between graph.cool and prisma generated schema. In graph.cool there is query to get posts called ‘allPosts’ with parameter ‘filter’, in prisma there is just ‘posts’ with parameter ‘where’. Is there a way how to unify it ? We use online graph.cool for Frontend development and schema editing and prisma for Backend development. I know we can do this transformation in prisma resolvers allPosts(filter) -> posts(where), but isn’t there some smoother way ? Anybody having experiences combining graph.cool and prisma ?
  • a

    ajmakhl

    03/15/2018, 4:04 PM
    Copy code
    componentWillReceiveProps = (nextProps) => {
        if (!nextProps.userQuery.loading) {
          if (nextProps.userQuery) {
            this.setState({ data: nextProps.userQuery.chats });
          }
        }
    I cant seem to refetch whenever i create a new chat
  • s

    sakhmedbayev

    03/15/2018, 4:11 PM
    I need to run graphql mutation from graphql-yoga middleware. Basically I need to update user status and then send redirect. How can I do it?
  • s

    sakhmedbayev

    03/15/2018, 4:12 PM
    I mean, how can I access graphql mutation within graphql-yoga middleware?
    l
    • 2
    • 23
  • u

    user

    03/15/2018, 4:13 PM
    @lawjolla commented on @manticarodrigo’s file https://prisma.slack.com/files/U9J4TSD7Z/F9QG2K37E/prisma_feed_query.txt: Is that query at Prisma or the GraphQL server? In the examples,
    feed
    is a GraphQL-Yoga type
    Prisma_Feed_Query.txt
  • u

    user

    03/15/2018, 4:14 PM
    @manticarodrigo commented on @manticarodrigo’s file https://prisma.slack.com/files/U9J4TSD7Z/F9QG2K37E/prisma_feed_query.txt: It’s a client-side query to
    graphql-yoga
    I guess. So I should move this to the server-side in the prisma resolver? EDIT: here?
    Copy code
    feed(parent, args, ctx, info) {
        return ctx.db.query.posts(null, info)
      },
    Prisma_Feed_Query.txt
  • a

    ajmakhl

    03/15/2018, 4:20 PM
    dam im stuck….
    Copy code
    nextProps.userQuery.refetch()
    gives an error when ever i create a new mutation but it doesnt when the page loads
  • u

    user

    03/15/2018, 4:20 PM
    @lawjolla commented on @manticarodrigo’s file https://prisma.slack.com/files/U9J4TSD7Z/F9QG2K37E/prisma_feed_query.txt: First edit your type to include order_by, e.g.
    Copy code
    type Query {
      feed(..., orderBy: String): ...
    }
    Then in your resolver...
    Copy code
    feed(parent, args, ctx, info) {
        return ctx.db.query.posts({
          orderBy: args.orderBy
        }, info)
      },
    Prisma_Feed_Query.txt
  • l

    lionstone

    03/15/2018, 4:25 PM
    Can anyone provide an example of how to properly invoke a local function that causes a mutation? I'm trying to do something like this:
    graphcool invoke-local --function signup --json src/invitation/test.json
    where test.json looks like
    Copy code
    {
      "email": "<mailto:benj@gmail.com|benj@gmail.com>",
      "password": "password"
    }
1...609610611...637Latest