Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting Backend to Frontend #4

Closed
oliver-pham opened this issue Dec 20, 2021 · 3 comments
Closed

Connecting Backend to Frontend #4

oliver-pham opened this issue Dec 20, 2021 · 3 comments
Labels
backend frontend priority:high Issue that needs urgent feedback/attention question Further information is requested
Projects

Comments

@oliver-pham
Copy link
Collaborator

oliver-pham commented Dec 20, 2021

There are two approaches to this:

  1. Fetch from REST API

Standard usage documentation
image

  1. Fetch from GraphQL Server
    Usage documentation (e.g. how data & queries look like) is defined in schemas:
type User {
    userID: String
    first_name: String
    last_name: String
    email: String
    bio: String
    password: String
    dob: Date
    sex: String
    location: Location
    hobbies: [String]
    preference: Preference
    avatar: Image
    photo: [Image]
}

We can implement both, but with the time constraint, we should prioritize either of them.

REST API

Pros

  1. No extra research/learning
  2. (Add more items)

Cons

  1. If a route is changed from the backend, frontend may also need to update the call to fetch data.
  2. (Add more items)

GraphQL

Approved by: @tuanthanh2067 @hlavu @mqnguyen5 @oliver-pham

Pros

  1. Changes in the backend won't break the frontend
  2. Avoid over-fetching & under-fetching data
  3. (Add more items)

Cons

  1. As a new technology, both frontend & backend need time to learn & implement
  2. (Add more items)
@oliver-pham oliver-pham added question Further information is requested frontend backend labels Dec 20, 2021
@oliver-pham
Copy link
Collaborator Author

@tuanthanh2067 tuanthanh2067 added this to To Do in Seeksi Jan 8, 2022
@tuanthanh2067 tuanthanh2067 moved this from To Do to Backlog in Seeksi Jan 8, 2022
@oliver-pham oliver-pham moved this from Backlog to To Do in Seeksi Jan 8, 2022
@oliver-pham oliver-pham added the priority:high Issue that needs urgent feedback/attention label Jan 8, 2022
@tuanthanh2067
Copy link
Owner

I'd prefer GraphQL as it's faster, and it's something new so we can learn while working with it.

@oliver-pham
Copy link
Collaborator Author

oliver-pham commented Jan 10, 2022

Since the majority has decided to go forward with GraphQL, we'll prioritize it over REST API (reference issue: #5)

@oliver-pham oliver-pham moved this from To Do to Done in Seeksi Jan 10, 2022
@oliver-pham oliver-pham reopened this Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend frontend priority:high Issue that needs urgent feedback/attention question Further information is requested
Projects
Seeksi
  
Done
Development

No branches or pull requests

2 participants