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

    artyom

    05/01/2017, 2:55 PM
    @joshhopkins @joshjoe @patstrz @morley 🙌 hi there, welcome! 🙂
  • m

    morley

    05/01/2017, 2:55 PM
    hi!, thanks!
    👋 1
  • j

    joshjoe

    05/01/2017, 2:55 PM
    @artyom Hi, thanks
    🙌 1
  • p

    patstrz

    05/01/2017, 2:55 PM
    👋 hi!
    👋 1
  • j

    joshjoe

    05/01/2017, 3:07 PM
    Just an FYI your tutorial here https://www.graph.cool/docs/tutorials/create-graphql-react-native-apps-with-apollo-client-weeg6chaiw/ is out of date. The react-router-native is at V4 so the code looks very different
    n
    • 2
    • 3
  • a

    adamibaker

    05/01/2017, 4:07 PM
    I’m considering a schema/model and could use some help in determining whether I’m going down the right path. In my app, users look at "items" which come from another data source (3rd party API). These items have a unique ID/"key" (string). A user may "like" (boolean) an item, or not, and record a "message" (string) about it. Users, and their interactions with thousands of items, are stored in Graphcool. I would like to be able to query for the "liked" items ("like" === true) and to make mutations to these items. Is this an appropriate way of structuring the data? Is there a better way?
    Copy code
    // SCHEMA/TYPE
    
    type User {
        id: ID! @isUnique
    	seenItems: [Json!]
        ...
    }
    
    // Example data
    [
    	{
    		'key': '567cd61b2eb732d3bf8ff31dabb39890b8ebee840e16b52a326362c8abe37be7',
    		'liked': true,
    		'message': 'lorem ipsum dolor emet'
    	},
    	{
    		'key': 'ba40d61af75117c0a96056eff7763ce072dde633e4d40c827e3f56820dff538e',
    		'liked': false,
    		'message': 'veridis quo'
    	},
        ...
    ]
    n
    • 2
    • 88
  • n

    nickyhajal

    05/01/2017, 5:02 PM
    Hey! If I have
    User
    and
    Domain
    and many users can each relate to many domains, I need to have a through model for
    UserDomain
    , like SQL, correct?
    Copy code
    type User {
      id
    }
    type Domain {
      id
    }
    type UserDomain {
      User
      Domain
    }
    Or does graphcool's many-many relation somehow remove that need?
    n
    s
    • 3
    • 3
  • n

    nickyhajal

    05/01/2017, 6:21 PM
    One other question - let's say I'm making a bitly clone, so I want to save the URL + generate a 5 character hash to be the unique reference to the URL. Is there anyway to do that sort of pre-processing server-side with graphcool?
    n
    • 2
    • 1
  • n

    nickyhajal

    05/01/2017, 6:22 PM
    Or I have to either generate it client-side or have a middle-man API that processes the request and forwards it on to graphcool?
  • a

    artyom

    05/01/2017, 6:24 PM
    @mmaddex @giray123 hello there, welcome to graphcool 🙌
  • j

    jjaybrown98

    05/01/2017, 7:14 PM
    hey @artyom or anyone who could help, I'd like to define permissions, but without using the integrations for authentication, my use-case is simple, I generate a unique UUID on the device, using a createUser query I can create users with this UUID, but not sure whether authentication will work, as the docs mentions a token
    n
    • 2
    • 2
  • j

    jjaybrown98

    05/01/2017, 7:14 PM
    I don't need to separate users as individuals, only their devices, for the moment
  • m

    morley

    05/01/2017, 8:41 PM
    Is there a way to import data, or should I write a script against the API to do that?
  • m

    morley

    05/01/2017, 8:42 PM
    Nevermind, I found the doc for this: https://www.graph.cool/docs/tutorials/importing-simple-data-ga2ahnee2a/
    n
    • 2
    • 1
  • a

    artyom

    05/01/2017, 9:37 PM
    @vmasalov @laurence welcome to graphcool 🖖
  • l

    laurence

    05/01/2017, 9:52 PM
    Thanks @artyom
  • a

    andrius

    05/01/2017, 10:31 PM
    if I have in schema
    faqsAnswers: [Json!]!
    how do I pass json object using lokka ?
    i
    n
    • 3
    • 29
  • h

    hueezer

    05/02/2017, 12:26 AM
    Hi ya’ll. I have a very simple schema type called Item and I’m trying to set up a many-to-many relationship. I was able to set it up successfully, but when actually trying to create relationships, the Web UI doesn’t seem to work very well. I can of course create a graphql mutation to do this and a custom UI, but was hoping I could use graphcool’s WebUI. Seems so close, just a little buggy.
    n
    • 2
    • 9
  • j

    jjaybrown98

    05/02/2017, 7:51 AM
    hey @hueezer I haven't found it to be buggy, what browser are you using, what bug do you see?
  • a

    afgh

    05/02/2017, 7:54 AM
    I’m wondering if there’s a way to hook up the auth system with a Slack signin? Auth0 doesn’t seem to support it.
    n
    • 2
    • 3
  • t

    theom

    05/02/2017, 8:00 AM
    So, I have an update mutation that I wish to update just my graphcool store, and not my apollo root_query(store), as I wish a subscription to handle that. But it is doing both, and I can't see why. My code is as follows:
    Copy code
    getCurrentPostLikesValueQuery(idVal) {
        return this.props.client.query({
          query: Get_Post_Likes_Query,
          variables: {
            'id': idVal
           },
        })
        .then(this.incrementPostLikesQuery)
        .catch(this.handleSubmitError);
      },
    
      incrementPostLikesQuery({data}) {
        const idVal = data.Posts.id;
        const incVal = data.Posts.likes + 1;
    
        return this.props.client.mutate({
          mutation: Increment_Post_Likes_Query,
          variables: {
            'id': idVal,
            'count': incVal
           },
        })
        .catch(this.handleSubmitError);
      },
    and my mutation is as follows:
    Copy code
    export const Increment_Post_Likes_Query = gql`
      mutation incrementPostLikes ($id: ID!, $count: Int) {
        updatePosts (id: $id, likes: $count) {
          __typename
          id
          likes
        }
      }
    `;
    What am I overlooking here?
    n
    l
    • 3
    • 7
  • j

    joar

    05/02/2017, 9:26 AM
    https://gist.github.com/craigbeck/b90915d49fda19d5b2b17ead14dcd6da
  • j

    joar

    05/02/2017, 9:26 AM
    This query crashes the playground for me
  • j

    joar

    05/02/2017, 9:26 AM
    Some sort of infinite loop
  • j

    joar

    05/02/2017, 9:26 AM
    tab using 1.3GB of memory
  • j

    joar

    05/02/2017, 9:26 AM
    constantly increasing
  • j

    joar

    05/02/2017, 9:27 AM
    its just a regular introspection query
  • n

    nilan

    05/02/2017, 9:27 AM
    did you try running the query directly to the api?
  • j

    joar

    05/02/2017, 9:27 AM
    It gets a reply from the server, so I think its a frontend issue
  • j

    joar

    05/02/2017, 9:30 AM
    now it rendered one frame. 1.5GB of memory
1...171172173...637Latest