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

    visualbbasic

    06/26/2017, 5:51 AM
    what would you do in this situation?
  • v

    visualbbasic

    06/26/2017, 5:51 AM
    (I guess another approach is to have draft form model in the backend but is it the only way?)
  • j

    joshmadewell

    06/26/2017, 6:59 AM
    I’m not using relay but I don’t see why you couldn’t use redux as well to store the state in a global store
    👍🏻 1
  • j

    joshmadewell

    06/26/2017, 6:59 AM
    or just have a parent component in your tree that stores the data in state
  • j

    joshmadewell

    06/26/2017, 7:00 AM
    if you want the user to “come back” after a refresh then yes, you’d want to send the data to the backend either way
  • y

    yus

    06/26/2017, 7:31 AM
    @visualbbasic with relay modern, you can have client side only state which you can use to collect form data. This is introduced to replace redux in the long run
    v
    • 2
    • 4
  • y

    yus

    06/26/2017, 7:32 AM
    I use relay classic which does not support this so i had to use redux to store my form values first then do a relay post at the final submit
  • a

    andyblack

    06/26/2017, 7:36 AM
    I'm using Apollo and React Router. My route is /profile/:id, so React Router sets props.match.id on my Profile component. But how can I then use that prop object in a query? I've tried
    query userById ($match.id: String!) { ... }
    but get an error that it doesn't like the dot
    n
    • 2
    • 1
  • l

    lefevre

    06/26/2017, 7:50 AM
    Hey. 🙂 Loving the platform so far - keep up the great work! 😄 I’m building a react-native app using GraphCool with a Relay Scheme. I have a QueryRenderer at the top-level fetching data via fragments to populate lists. This data is actual data on GraphCool, so these are working fine. My problem arise when i want to expand this query with enum values i have defined. I got a single query working, by using https://www.graph.cool/forum/t/how-to-access-the-possible-values-of-an-enum-type-created-inside-the-console/23/2, but I can’t seem to find a way to implement it with fragments (If at all possible). My current query:
    Copy code
    query ReportingContainerQuery {
        viewer {
            ...MainList_items
        }
    }
    This is the part i want to expand with the following (But formatted as a fragment inside the React-native component which is going to use it):
    Copy code
    query {
      __type(name:"[ENUM_NAME]") {
        enumValues{
          name
        }
      }
    }
    Hope that made sense. 🙂
    n
    • 2
    • 16
  • u

    user

    06/26/2017, 8:20 AM
    @nilan commented on @kjetilge’s file https://prisma.slack.com/files/U553MFEHW/F5YM8739P/data_not_loading_after_deploy_to_surge_sh.txt: how does the query look like? it looks like the query has no
    Authorization
    header
    Data_not_loading_after_deploy_to_surge_sh.txt
  • f

    fredibach

    06/26/2017, 11:56 AM
    In a Graphcool app I'm working on, I would like to sort by proximity. Any idea how to implement this with Graphcool without working around it by loading all coordinates into the app and than just load the close by locations in a second query?
    n
    a
    • 3
    • 12
  • p

    picosam

    06/26/2017, 12:40 PM
    Hello, I have a type that contains the history of
    User
    statuses, the last node created being the current status. Within a different query, I’m trying to find out the count of users that have a status of
    OK
    . Here’s what I’m trying:
    _allUsersMeta(filter: {statusHistory_some: {status: OK}}) { count }
    The problem with this is that, at any point in history, if the user was marked as
    OK
    , this will return true. So how do I order by
    createdAt_DESC
    and make sure I only have the
    first: 1
    value, that is the latest status of the user?
    n
    • 2
    • 31
  • g

    gojutin

    06/26/2017, 1:57 PM
    Hi everyone, I am new to this channel and Graphcool. I am really loving the service and the whole GraphQL experience! I am using an embedded instance of Auth0 Lock for auth on a project. I originally set it up similar to the Apollo-Auth0 example but noticed that there is a flash (between route redirects) during the moment between logging in with Auth0 and the server responding with a Graphcool user Id (if there is one). I’d like to make it so that when a user logs in with Auth0, there is a spinner until the server checks if a user exists in GraphQL and responds and only reroutes (React Router v4) once the server actually responds (as opposed to an initial route change and re-reroute when the server responds). Any tips would be greatly appreciated. Thanks!
    👋 2
    a
    • 2
    • 2
  • g

    geirman

    06/26/2017, 2:48 PM
    I would like to transform the response object based on existing data and context. For instance, I would like to concatenate “firstname” and “lastname” to add a “fullname”. Must this be done on create & update only, or can this be a dynamic field created on query?
    n
    • 2
    • 1
  • g

    geirman

    06/26/2017, 2:51 PM
    Maybe more interesting, Given two objects, User & Event. In Events, I have a array of “managers” which are of course users. I would like users to see any events they manage, but also would like to add an “isManager=true” to their user object so that I can customize the UI. I will also have an “isSponsor” that will add different customizations.
    n
    n
    • 3
    • 36
  • g

    geirman

    06/26/2017, 2:53 PM
    I thought a pipeline function might be the way to go, but the option to create one on request (query) isn’t available.
  • g

    geirman

    06/26/2017, 3:07 PM
    Given this error message… “A function returned an unhandled error. Please check the logs for executionId ‘cj4e9wb6oas9c0185xejs9wvq’” How do we check the log? Where can this log be found?
    n
    • 2
    • 3
  • s

    szlangini

    06/26/2017, 3:46 PM
    Hi everyone, we got a problem with functions. Our function is triggered when a "Post" is updated. now our problem is, that although we make a mutation (generated a like oder a comment), the post (in Graph.Cool Database) doesn't change it's updatedAt value
  • s

    szlangini

    06/26/2017, 3:46 PM
    (the mutation is stored though, for example we get a new comment object in comment array
    n
    • 2
    • 11
  • s

    szlangini

    06/26/2017, 3:47 PM
    how do we update?
  • k

    kgoggin

    06/26/2017, 8:56 PM
    anyone know if it's possible to fire off a separate mutation inside a graph.cool function? use case: create a new entity when a file is uploaded
  • j

    jasonbahl

    06/26/2017, 9:58 PM
    are there CLI tools to run GraphQL operations, like queries/mutations? I know there are tools now that help create GraphQL servers, etc. . .but curious if there are CLI tools that allow you to easily fetch data out of a GraphQL API, etc
  • y

    yus

    06/26/2017, 10:02 PM
    Definitely. Look at this example, it uses server side subscription to update a customer after it has been created https://github.com/graphcool-examples/functions/blob/master/stripe-create-customer-es6/src/createStripeCustomer.js
    k
    n
    • 3
    • 2
  • y

    yus

    06/26/2017, 10:03 PM
    You can use curl to post to your graphcool endpoint
    👍 1
  • a

    agartha

    06/27/2017, 12:41 AM
    Any updates on the https://www.graph.cool/docs/faq/graphcool-changelog-chiooo0ahn/?
    n
    • 2
    • 1
  • b

    be4r

    06/27/2017, 3:56 AM
    i am querying user through option fetchPolicy: ‘network-only’
  • b

    be4r

    06/27/2017, 3:56 AM
    but the data.user is always returning null
  • b

    be4r

    06/27/2017, 3:56 AM
    if i refresh, the user does show
  • p

    ppanagi

    06/27/2017, 5:46 AM
    Hi all, I'm following the quickstart guide for this example https://github.com/graphcool-examples/react-graphql/tree/master/quickstart-with-relay-modern, but getting a
    'viewerId' is not defined
    error:

    https://puu.sh/wvkiM/79223c4be9.png▾

    n
    • 2
    • 4
  • f

    florian

    06/27/2017, 8:37 AM
    Hi, I'm using
    react-apollo
    and have been able to sucessfully create a signUp / signIn flow with Auth0 and graphcool. I have multiple components scattered around my app querying the user endpoint, is there a recommended way on how to relaunch those queries when an authenticated event is triggered ? (Right now I'm reloading the whole page)
1...246247248...637Latest