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

    codepreneur

    01/23/2017, 1:49 PM
    instead of connection
  • c

    codepreneur

    01/23/2017, 1:50 PM
    Copy code
    allVideos: {
          type: allVideosConnection.connectionType,
          args: Object.assign(
            {},
            connectionArgs
          ),
          resolve: (_, args) => {
  • c

    codepreneur

    01/23/2017, 1:50 PM
    this one has connection
  • c

    codepreneur

    01/23/2017, 1:50 PM
    and this one
  • c

    codepreneur

    01/23/2017, 1:50 PM
    Copy code
    Video: {
          type: oneVideoType,
          args: Object.assign(
            {},
            connectionArgs,
            {id: {type: GraphQLString}}
          ),
          resolve: (_, args) => {
    
    
    `
  • c

    codepreneur

    01/23/2017, 1:50 PM
    should be just graphql object type
  • c

    codepreneur

    01/23/2017, 1:50 PM
    or its not possible ?
  • c

    codepreneur

    01/23/2017, 1:50 PM
    Copy code
    const oneVideoType = new GraphQLObjectType({
      name: 'OneVideo',
      fields: () => ({
        id: {
          type: new GraphQLNonNull(GraphQLID),
          resolve: (obj) => obj.id
        },
        name: { type: GraphQLString },
        url: { type: GraphQLString }
      }),
      interfaces: [nodeDefs.nodeInterface]
    })
  • c

    codepreneur

    01/23/2017, 1:51 PM
    is it possible that graphql returns object instead of list/connection all the time ?
  • c

    codepreneur

    01/23/2017, 1:51 PM
    Copy code
    let nodeDefs = nodeDefinitions(
      (globalId) => {
        let type = fromGlobalId(globalId).type
        if (type === 'Store') {
          return store
        }
        if (type === 'OneVideo') {
          return video
        }
        return null
      },
      (obj) => {
        if (obj instanceof Store) {
          return storeType
        }
        if (obj instanceof Video) {
          return oneVideoType
        }
        return null
      }
    )
  • c

    codepreneur

    01/23/2017, 1:52 PM
    I am sure the way graph.cool is built, they are doing it somehow in the backend
  • c

    codepreneur

    01/23/2017, 1:53 PM
    I get syntax error if I do this
  • c

    codepreneur

    01/23/2017, 1:53 PM
    but why ?
  • s

    schickling

    01/23/2017, 1:55 PM
    Hey @codepreneur. Graphcool is built in Scala using Sangria. I think the best place to get help with your problem would be Stackoverflow as we can help you best with Graphcool related questions ๐Ÿ™‚
  • c

    codepreneur

    01/23/2017, 1:56 PM
    ohh wow
  • c

    codepreneur

    01/23/2017, 1:56 PM
    I thought its built in javascript D
  • c

    codepreneur

    01/23/2017, 1:56 PM
    haha
  • s

    schickling

    01/23/2017, 1:57 PM
    The initial version was built in Node but it became clear very quickly that Javascript is not a scalable solution for this problem and doesnโ€™t provide the necessary stability for our customers.
  • c

    codepreneur

    01/23/2017, 1:58 PM
    yeah, but if you combined Node with aws lambda/serverless architectures it would beat Scala
  • c

    codepreneur

    01/23/2017, 1:58 PM
    since cold start time for Java/Scale in AWS is a non starter
  • c

    codepreneur

    01/23/2017, 1:58 PM
    too slow
  • c

    codepreneur

    01/23/2017, 1:58 PM
    but yeah, without aws lambda, Node is a non starter
  • c

    codepreneur

    01/23/2017, 1:58 PM
    I agree
  • s

    schickling

    01/23/2017, 1:58 PM
    Agree, in that case Node is a good solution. Most of our Lambda services are written in Go though.
  • c

    codepreneur

    01/23/2017, 1:59 PM
    or that
  • c

    codepreneur

    01/23/2017, 1:59 PM
    Node ecosystem is bigger/better
  • c

    codepreneur

    01/23/2017, 1:59 PM
    so quicker and easier to build lambda services
    ๐Ÿ‘ 1
  • t

    thisismissem

    01/23/2017, 3:45 PM
    @codepreneur I'd definitely not be writing something like Graphcool in node.js โ€“ coming from someone that's been doing node.js since before it was cool (mid-2009)
  • t

    thisismissem

    01/23/2017, 3:46 PM
    Also, for this application, using lambda/serverless would be risky: you really want things that you know will work โ€” lambda/serverless is better for smaller logic modules
  • n

    nilan

    01/23/2017, 4:35 PM
    hey there @cullan and @arthurtayrac ๐Ÿ™Œ
1...838485...637Latest