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

    bobbyt

    06/10/2017, 12:50 PM
    Hi! I'm running into an issue with setting up a subscription that checks for changes to a field that references another type. For example, this subscription works fine (data is received if the "username" field is ever updated for the current user):
    Copy code
    subscription userPosts {
      User(
        filter: {
          updatedFields_contains: "username"
        }
      ) {
        mutation
        node {
        	posts {
            createdBy {
              name
            }
            description
            status
        	}
        }
        updatedFields
      }
    }
    But when I switch
    updatedFields_contains
    to a field that references another type (i.e. "posts" field in User type references many Posts), any updates to my Post data will not be intercepted by the subscription:
    Copy code
    subscription userPosts {
      User(
        filter: {
          updatedFields_contains: "posts" <----- nothing happens when Post data is updated
        }
      ) {
        mutation
        node {
        	posts {
            createdBy {
              name
            }
            description
            status
        	}
        }
        updatedFields
      }
    }
    Here is my User schema:
    Copy code
    type User implements Node {
      auth0UserId: String @isUnique
      comments: [Comment!]! @relation(name: "CommentsByUser")
      createdAt: DateTime!
      id: ID! @isUnique
      name: String!
      posts: [Post!]! @relation(name: "PostsByUser")
      updatedAt: DateTime!
      username: String
    }
    Is there another way to use
    updatedFields_contains
    with a field that references another type? Thanks!
    a
    • 2
    • 21
  • b

    busk

    06/10/2017, 2:19 PM
    Hey guys, I'm trying to wrap my head around something in regards to GraphQL. Specifically, how can I make sure that a users email has been confirmed when I'm not using Auth0? Serviceside subscriptions are async, so too late. The request pipeline doesn't allow me to do something with read requests and the email-password auth integration is not modifiable...
    a
    h
    n
    • 4
    • 17
  • g

    gildas

    06/10/2017, 5:01 PM
    Hi!
    Whoops. Looks like an internal server error. Please contact us in Slack (https://slack.graph.cool) and send us your Request ID: cj3rj2nas4gvq0177qex879mp
    s
    • 2
    • 3
  • n

    nilan

    06/10/2017, 6:12 PM
    @agartha had a great idea about a IFTTT or Zapier integration for Graphcool: https://github.com/graphcool/feature-requests/issues/238 would love to find someone in the community to collaborate on this. Anyone interested? πŸ™‚
    a
    d
    • 3
    • 51
  • a

    agartha

    06/10/2017, 8:07 PM
    Can anyone give me a 101 on when to use the different githubs feature-request, api-bugs, console, ui-feedback? For example, should feature-requests for the console go into feature-request, console, or ui-feedback?
  • n

    nilan

    06/10/2017, 8:15 PM
    feature-request πŸ™‚
  • d

    dk0r

    06/10/2017, 10:26 PM
    I'd like to confirm whether I'm understanding
    relations
    correctly. In the following example, is it the case that every
    Team
    requires an associated
    User
    , but not every
    User
    requires an associated
    Team
    ?

    http://i.imgur.com/tE6uizo.pngβ–Ύ

  • d

    dk0r

    06/10/2017, 10:29 PM
    Also, is it the case that due to the
    many-to-one relation
    shown above, that each
    Team
    can be related to multiple users but each
    User
    can only be related to one
    Team
    ?
  • y

    yus

    06/10/2017, 10:29 PM
    @dk0r Team.users === [] is a valid entry in the Team type
    d
    n
    a
    • 4
    • 172
  • j

    jpdesigndev

    06/11/2017, 1:34 AM
    Hello all. Just trying out graph.cool for the first time, and am running into a bit of a wall. First off.. Are interfaces supported? I see the Interfaces (coming soon) tab, but I don't know if this is just a UI for interfaces... If interfaces are not supported, how are folks pulling off more complex scenarios such as multiples types of users...
    User -> Provider | Customer
    ?
    a
    d
    s
    • 4
    • 25
  • d

    dk0r

    06/11/2017, 1:46 AM
    @ajmakhl you're probably going to have to provide more info than that for a sufficient respone..
  • a

    ajmakhl

    06/11/2017, 1:48 AM
    oh sorry. I am using Auth0 with react native. I used the example code. The account is being created but it isnt saved in the graphcool data. I can send my code I have if that can help
    a
    d
    n
    • 4
    • 30
  • e

    eliezedeck

    06/11/2017, 1:49 AM
    @nilan @sorenbs I have tested again
    subscriptions-transport-ws@0.7.1
    this morning. While there is no longer a 400 error message, the server is sending a message of type β€œkeepalive”, which is not exactly what the client expects. Instead, it expects β€œka” for KEEP_ALIVE messages type. Because of this, the next error I see in the console is:
    Copy code
    Uncaught Error: Invalid message type!
        at SubscriptionClient.processReceivedData (client.js:387)
        at WebSocket.client.onmessage (client.js:329)
  • f

    fourcolors

    06/11/2017, 5:04 AM
    Hey guys, I haven an idea for your service.
  • f

    fourcolors

    06/11/2017, 5:06 AM
    It would be really freaking cool if when you are creating your custom functions, you could select from a list of pre-created common functions that will automatically set up your project in the right way. For instance, if you wanted to created a Stripe payment and send an email, it would be nice to select the mailgun pre-created function, stripe pre-created function and they fill in the blanks with the keys, drag/drop them (almost like the MIT labs drag/drop programming or mindstorm lego programming) and have everything work.
    πŸ‘πŸ» 4
    n
    • 2
    • 4
  • f

    fourcolors

    06/11/2017, 5:06 AM
    Just an idea, you might be already working on it though.
    s
    • 2
    • 1
  • f

    fourcolors

    06/11/2017, 5:49 AM
    I guess kind of like what webtask.io does
  • s

    sorenbs

    06/11/2017, 11:22 AM
    @eliezedeck and everyone else interested in using the latest version of the subscriptions protocol. Graphcool is now compatible with 0.7.x as well as older versions of the protocol. As a temporary workaround you need to manually configure the timeout as detailed in https://github.com/apollographql/subscriptions-transport-ws/issues/149#issuecomment-307622783
    πŸ‘πŸ» 2
    a
    e
    d
    • 4
    • 19
  • b

    bartamon

    06/11/2017, 1:39 PM
    Anybody have experience using graphcool and Ionic3?
  • e

    eliezedeck

    06/11/2017, 1:45 PM
    @sorenbs @nilan another topic: about data races that no one seems to be talking about. I have already presented this concern with @nilan but haven’t received any response yet. May be this is probably because of my less experienced GraphQL self as well, but looking at the Subscriptions, wouldn’t there be a possibility of subscription loss between the first REST API call to get initial data, and subscribing for more? I mean, this is a problem at the GraphQL protocol itself if I understand well, unless there is a Live Queries 100% over WebSocket. The time between these 2 calls can easily be 300 ms in my case, and a lot can happen in 300 ms.
    n
    a
    • 3
    • 10
  • d

    dk0r

    06/11/2017, 2:02 PM
    Is there any way to prevent graph.cool from alphabetically organizing my fields? Each type's field would be a lot more humanly legible if they were organized in the order in which I created them:

    http://i.imgur.com/bunafYv.pngβ–Ύ

    a
    n
    • 3
    • 41
  • a

    agartha

    06/11/2017, 2:48 PM
    I just happened to see an update on the #feedback channel that told me you can drag/drop files to the databrowser to upload. Is that documented anywhere, or waiting for a better implementation? I think it would be useful to know for many users.
  • n

    nilan

    06/11/2017, 2:49 PM
    It was mentioned in the changelogs and I'm about to update the File API docs about this as well πŸ˜‰ https://www.graph.cool/docs/faq/graphcool-changelog-chiooo0ahn/#week-13-(march-27-april-2)
    😍 1
    πŸ‘πŸ» 1
  • n

    nilan

    06/11/2017, 2:53 PM
    Hey everyone I recently setup the #feedback channel to track updates across the different issue trackers and feature requests on GitHub πŸ™‚ This should help everyone to keep track of changes and participate in the different discussions πŸŽ‰
    πŸ‘πŸ» 1
    a
    • 2
    • 3
  • a

    agartha

    06/11/2017, 4:34 PM
    I'm experimenting with permission queries, and I have a question about how they are combined. Apparently, all permissions are considered 'allow' permissions, and combined like that. But I think permission queries are actually 'deny' permissions (it's a query that returns false if you are not allowed to see something). However, it doesn't work like that. Can anyone explain the reasoning?
    n
    • 2
    • 6
  • s

    socialgraph

    06/11/2017, 4:37 PM
    Is it just me or would anyone else like to be able to write functions that respond to an HTTP endpoint? Vote on this comment.
    πŸ‘ 1
    a
    n
    • 3
    • 7
  • p

    pascalo

    06/11/2017, 7:45 PM
    I'm trying out plain HTTP mutations, with the code below, I get a "FetchError" - message: 'invalid json response body at https://api.graph.cool/simple/v1/myendpointxxx reason: Unexpected token T'. Any ideas?
    n
    • 2
    • 1
  • p

    pascalo

    06/11/2017, 7:46 PM
    fetch(
    ${GRAPHQL_ENDPOINT}
    , { method: 'post', headers: { 'Content-Type': 'application/json', 'Authorization':
    Bearer ${PAT}
    }, body: '{"query":"mutation { createPost( imageUrl: \"https://facebook.github.io/react/img/logo_og.png\" description: \"my-great-meteor\") {id }}"}', }) .then((response) => { if (response.status > 400) { throw new Error("Bad response from server") } else { return response.json() } }) .then((response) => { console.log(response); }) .catch((error) => { console.log(error); });
  • d

    dtuite

    06/11/2017, 10:04 PM
    Is it possible to perform a mutation on a record which is currently going through the DB write flow? I want to update the record depending on the state of some other DB models. Pseudo-code included.
    Update_during_write_.js
  • d

    drk

    06/11/2017, 10:35 PM
    are there any known issues w/ migrating schemas containing ENUMS and default values?
    n
    • 2
    • 4
1...225226227...637Latest