https://www.prisma.io/ logo
Join Slack
Powered by
# random
  • b

    brad.barnes

    01/28/2017, 1:10 PM
    2) What if there was a super graphQL structure: mutation($model: String!, $mutation: String!, $id: String!, $changingVar: String!){ updateModel(model : $model, mutation: $mutation, id: $id, changingVar: $changingVar){ id } } This may simplify api gql tag use for using models that are alike but need to be different. Or maybe I'm just thinking too much...
  • n

    nilan

    01/28/2017, 1:13 PM
    @brad.barnes ,two things
  • n

    nilan

    01/28/2017, 1:14 PM
    ids are unique across all projects even
  • n

    nilan

    01/28/2017, 1:14 PM
    we use https://github.com/graphcool/cuid-java
  • n

    nilan

    01/28/2017, 1:14 PM
    you can use node(id) query
    👍 1
  • b

    brad.barnes

    01/28/2017, 1:18 PM
    @nilan Thanks! With node(id) can you return the model type?
  • n

    nilan

    01/28/2017, 1:20 PM
    no you have to use fragments I guess
  • n

    nilan

    01/28/2017, 1:20 PM
    your second point sounds interesting but it's not something yet possible. at some point we might think of an npm package for example That offers this
  • b

    brad.barnes

    01/28/2017, 1:26 PM
    @nilan Yeah, I was thinking it would save the front end developer from a lot of: if object.type === "something": huge gql tag... repeat...
  • n

    nilan

    01/28/2017, 1:41 PM
    hmm so what is the final query you are running? seems you want to fetch multiple things at once?
  • b

    brad.barnes

    01/28/2017, 1:48 PM
    @nilan Just one query from a reusable react list element component that serves multiple models...just thinking too much
  • b

    brad.barnes

    01/28/2017, 1:56 PM
    @nilian Then again I do like to put all my gql tags into a node export object and call them in my component files like: ModelApi.mutate.updateModelFieldById
  • n

    nilan

    01/28/2017, 1:57 PM
    ahh I see
  • n

    nilan

    01/28/2017, 1:58 PM
    is it a static set of different models?
  • b

    brad.barnes

    01/28/2017, 2:00 PM
    No, just the the tags.
  • b

    brad.barnes

    01/28/2017, 2:01 PM
    @nilan later I call them with graphql(ModelApi.query.allModels...or plug in the vars that the tag asks for
  • t

    thisismissem

    01/30/2017, 10:28 AM
    With node(id) can you return the model type?
    Couldn't you do
    node(id) { __typename }
  • t

    thisismissem

    01/30/2017, 10:28 AM
    that is, the same way introspection works
  • s

    schickling

    01/30/2017, 10:28 AM
    Yup
  • n

    nilan

    01/30/2017, 10:28 AM
    right!
  • t

    thisismissem

    01/30/2017, 10:28 AM
    @brad.barnes ^^
  • m

    mfts0

    02/05/2017, 1:38 PM
    @nilan @sorenbs do you guys have an apple tv remote at your office by any chance?
    🍏 1
  • s

    sorenbs

    02/05/2017, 2:15 PM
    nope, sorry
  • j

    jero2rome

    02/06/2017, 10:37 PM
    You guys never sleep 😂
  • s

    schickling

    02/06/2017, 10:55 PM
    💪
  • a

    artyom

    02/06/2017, 11:10 PM
    💪
  • a

    aryan

    02/14/2017, 6:44 PM
    hey guys, thought you might find this interesting. I was struggling which composer to pick (i.e. komposer2 vs recompose vs react-apollo's compos), this I think settles it. https://dev-blog.apollodata.com/simplify-your-react-components-with-apollo-and-recompose-8b9e302dea51#.gyghodvdk
    👍 1
  • n

    nilan

    02/14/2017, 6:45 PM
    Nice! Also saw that and remember our little conversation about that 🙂
  • s

    sashko

    02/14/2017, 7:34 PM
    @aryan glad it was helpful! The
    react-apollo
    compose function is provided as a convenience in case you don't want to import recompose
    👍 2
  • a

    aryan

    02/14/2017, 8:20 PM
    @sashko thanks for the clarification on react-apollo
12345...53Latest