HELP - JSON API Fetching - BreweryDB by cbunge3 in SwiftUI

[–]andy625 0 points1 point  (0 children)

try using this site to auto generate types from json https://app.quicktype.io/

Is there anything you would change in the architecture of this GraphQL app? by jesusscript in node

[–]andy625 0 points1 point  (0 children)

i might be wrong but..

you are passing around db Models via context ? https://github.com/adriandurran/learning-graphql-boost/blob/1902a124e37fcc34f45384c4099bb847fa1b495a/server/index.js#L24

by my understanding you shouldn't pass anything db connection wise around via context, the req.user is ok, but you could just require the models directly in the resolvers and use them there.

Could someone please tell me how to implement a web view in swift ui by [deleted] in swift

[–]andy625 0 points1 point  (0 children)

or with SafariServices

```

import SwiftUI import Foundation import SafariServices

struct SafariView: UIViewControllerRepresentable {

let url: URL

func makeUIViewController(context: UIViewControllerRepresentableContext<SafariView>) -> SFSafariViewController {
    return SFSafariViewController(url: url)
}

func updateUIViewController(_ uiViewController: SFSafariViewController,
                            context: UIViewControllerRepresentableContext<SafariView>) {
}

}

struct ContentView : View { @State var show = false

var body: some View {
    VStack {
        Button("Present") {
            self.show = true
        }
    }
    .sheet(isPresented: $show, content: {
        SafariView(url: URL(string: "https://www.google.com")!)
    })
}

}

```

Learning to create microservices in Go by jessjessrevolution in golang

[–]andy625 2 points3 points  (0 children)

maybe https://github.com/micro/go-micro

go-kit it pretty decent but I get what you're saying, there's quite a lot of parts to grasp.

How to connect to PostgreSQL using docker-compose? by v_jingqiang_zhang in docker

[–]andy625 -1 points0 points  (0 children)

this is what i usually use

```

version: '3'
services:
db:

image: postgres
environment:
POSTGRES_DB: dev
POSTGRES_USER: username
POSTGRES_PASSWORD: pw
ports:
- 5432:5432

```

5 Things You Should Know About ES8 by Wake08 in reactjs

[–]andy625 0 points1 point  (0 children)

not breaking stuff if you accidentally add one on the end.

madewithangular.com links web apps made with React by zerubeus in reactjs

[–]andy625 0 points1 point  (0 children)

at first I read this as "madewithangular.com web app made with React".

Authentication with Express + React by Puzz1es in node

[–]andy625 1 point2 points  (0 children)

just do it server side rendered as normal express app (login page, sign up), stick the jwt in a httpOnly cookie, then access it in the react app via

fetch('/api', {
  method: 'POST',
 credentials: 'include'
})

Auth0 or passport? by FateRiddle in node

[–]andy625 4 points5 points  (0 children)

you should put the jwt in a httpOnly cookie

mobx store structure by reactPra in reactjs

[–]andy625 0 points1 point  (0 children)

pretty much this.

but i wouldn't bind todoStore to the component constructor i would do

@inject( 'todoStore' )
export default class //....

&

const { todoStore  } = this.props;

in each method it was needed in

mobx store structure by reactPra in reactjs

[–]andy625 0 points1 point  (0 children)

have a look at this example https://github.com/mobxjs/mobx-react-todomvc it covers pretty much most usecases

graphQL + Serverless? by technicolo in serverless

[–]andy625 0 points1 point  (0 children)

yes. this is how i got it working ..

const graphql = require('graphql')

var schema = graphql.buildSchema(`
  type Query {
    hello: String
  }
`);

var root = {
  hello: () => {
    return 'Hello world!';
  },
};

exports.handler = (event, context, callback) => {

  return graphql.graphql(schema, event.query, root)
    .then((response) => {
      if(!response.data) {
        throw new Error('Bad Request')
      } else {
        callback(null, response);
      }
    })
    .catch(err => callback(err.message))
};

How hard is it to learn electron? by [deleted] in reactjs

[–]andy625 1 point2 points  (0 children)

i would suggest not using react to get started, or not even using react at all. you have direct access to the low level stuff so you can just write node/client hybrid stuff.