[{"data":1,"prerenderedAt":241},["ShallowReactive",2],{"project-16352611":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":35,"aspects":36,"strip":38,"post_text":41,"what":42,"said":68,"maker_in_thread":129,"shape":138,"grid":141,"attempts":203,"same_week":204,"maker_shows":31,"maker_hidden":233,"reader_version":234,"card":235},"16352611","gqlgen","Generating GraphQL servers for Go","title","Show HN: Generating GraphQL servers for Go","https:\u002F\u002Fgithub.com\u002Fvektah\u002Fgqlgen","github.com","vektah",1518356028,2018,172,29,221,2155,11,"notable","languages","graphql code generator","library",[24,25,26,27],"golang graphql","graphql server generator","go graphql","schema first","curious",0.029,{"positive":31,"neutral":32,"mixed":33,"critical":34},1,7,0,2,10,{"idea":37},{"positive":31,"critical":34},[33,33,33,33,33,33,33,33,31,39,39,33,33,39,31,33,33,40,39,39,33,33,33,33,39,33,33,33,39],3,5,null,{"problem":43,"audience":54,"pricing":41,"motivation":41,"time_to_build":41,"stack":61,"openness":67,"stage":67,"team_size":67},{"value":44,"source":45,"evidence":46},"Writing GraphQL server routing and boilerplate for Go by hand","inferred",[47,51],{"id":48,"by":49,"text":50},"16352759","Blackstone4","Background: I've been using Typescript + graphql-yoga\u002Fapollo-server\u002Fexpress + Prisma to create a GraphQL server. I'm not familiar with golang. I found this interesting. So just…",{"id":52,"by":11,"text":53},"16352850","Yeah, it takes your schema and your models and generates as much of the resolver graph as it can, then leaves you with an interface to implement for the bits it cant (usually…",{"value":55,"source":56,"evidence":57},"Go developers with existing apps who want GraphQL servers","maker",[58],{"id":59,"by":11,"text":60},"16352832","Yeah, would be more for existing apps that already have a bunch of domain logic.",[62],{"value":63,"source":45,"evidence":64},"Go",[65],{"id":66},"post","unknown",{"praise":69,"objections":78,"requests":92,"questions":93,"alternatives":104},[70],{"value":71,"source":72,"evidence":73},"Interesting and useful for Go GraphQL developers","commenter",[74],{"id":75,"by":76,"text":77},"16352762","sorenbs","This is super cool. It looks very similar to graphql-binding https:\u002F\u002Fgithub.com\u002Fgraphql-binding\u002Fgraphql-binding GraphQL Bindings are generated from a GraphQL schema and provides…",[79,85],{"value":80,"source":56,"evidence":81},"Types-first generation is hard for unions, enums and directives",[82],{"id":83,"by":11,"text":84},"16356082","I explored going type first before writing this and you could get pretty close. The details get hard though, how do you represent unions vs enums? even knowing what implements an…",{"value":86,"source":72,"evidence":87},"Schema-first approach may not suit typed languages",[88],{"id":89,"by":90,"text":91},"16353555","013a","I feel that, in typed languages, the only GraphQL oriented code you should be writing is the schemas and the resolvers. Manually implementing the models in your language's type…",[],[94,100],{"value":95,"source":72,"evidence":96},"Is it production ready?",[97],{"id":98,"by":99,"text":95},"16356838","akmittal",{"value":101,"source":72,"evidence":102},"Does it generate routing and how much resolver code is needed?",[103],{"id":48,"by":49,"text":50},[105,109,115,122],{"value":106,"source":72,"evidence":107},"graphql-binding",[108],{"id":75,"by":76,"text":77},{"value":110,"source":72,"evidence":111},"Juniper (Rust)",[112],{"id":113,"by":90,"text":114},"16353718","I'd imagine any decent library would provide an escape hatch around the codegen, so you can specify your own types if you'd like. The other option is to only write the Go types,…",{"value":116,"source":72,"evidence":117},"samsarahq\u002Fthunder",[118],{"id":119,"by":120,"text":121},"16356453","theswan","At Samsara our golang graphql implementation (https:\u002F\u002Fgithub.com\u002Fsamsarahq\u002Fthunder) works this way. We write out resolver functions using plain old go types and use some…",{"value":123,"source":72,"evidence":124},"Prisma",[125],{"id":126,"by":127,"text":128},"16352787","thangngoc89","This only generates the server and you need to write your own resolvers, connect to database, ... Prisma on the other hand handle everything out of the box for you.",{"comments":40,"answered":34,"key":130},[131,132,135],{"id":83,"text":84},{"id":133,"text":134},"16356098","graphql is just one representation of your applications data, it shouldn't dictate your models. I'm thinking about adding something that generates a model if it doesn't exist,…",{"id":136,"text":137},"16352871","I think its still pretty early days, the easy stuff is fine. Once you throw in data loading or subscriptions you quickly run out of docs or find that its just flat out…",{"commenters":139,"max_depth":40,"maker_replies":40,"first_comment_mins":140,"lifespan_hours":15},13,42,[142,146,148,150,153,155,157,160,162,164,168,169,172,174,177,179,180,181,183,185,187,190,192,194,195,196,197,199,200],[143,33,33,144,145,33],"16352991","commenter\u002Fneutral\u002Fnone","faizshah",[147,33,33,144,76,33],"16353063",[149,33,33,144,145,33],"16353231",[151,33,33,144,152,33],"16353118","realPubkey",[154,33,33,144,145,33],"16353360",[156,33,33,144,152,33],"16353528",[158,33,33,144,159,33],"16353890","orbitur",[161,33,33,144,145,33],"16354101",[89,31,31,163,90,33],"project\u002Fcritical\u002Fidea",[165,31,39,166,167,33],"16353647","project\u002Fneutral\u002Fidea","wyattjoh",[113,31,39,166,90,33],[170,31,33,171,76,33],"16355808","other\u002Fneutral\u002Fnone",[83,31,33,173,11,31],"maker\u002Fneutral\u002Fidea",[175,31,39,166,176,33],"16354500","a-saleh",[178,31,31,163,90,33],"16360778",[133,31,33,173,11,31],[119,31,33,171,120,33],[75,34,40,182,76,33],"project\u002Fpositive\u002Fidea",[48,39,39,184,49,33],"maker\u002Fneutral\u002Fnone",[186,39,39,184,49,33],"16352779",[188,39,33,171,189,33],"16352793","sebastian",[191,39,33,171,49,33],"16352874",[193,39,33,171,49,33],"16352901",[136,39,33,184,11,31],[126,39,39,166,127,33],[59,39,33,184,11,31],[198,39,33,144,49,33],"16352836",[52,39,33,184,11,31],[98,201,39,202,99,33],4,"project\u002Fneutral\u002Fnone",[],[205,210,215,220,224,228],{"id":206,"name":207,"points":208,"category":209},"16339004","TablePlus",333,"dev_tools",{"id":211,"name":212,"points":213,"category":214},"16368653","ModelDepot",324,"ai",{"id":216,"name":217,"points":218,"category":219},"16366275","Apify Page Analyzer",166,"web_saas",{"id":221,"name":222,"points":223,"category":209},"16357757","just-dashboard",159,{"id":225,"name":226,"points":227,"category":209},"16336575","Thanks",138,{"id":229,"name":230,"points":231,"category":232},"16364805","Takehome.io",134,"productivity",false,"v2",{"id":236,"name":5,"line":6,"ai":233,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":237,"top":18,"kw":238,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":239,"url":9,"mix":240,"praise":71,"objection":80,"sub":21},16352611,0.03,[24,25,26,27],"00000000133003100533000030003",[31,32,33,34],1794036563340]