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

Proposal: GraphQL Implementation #84

Open
evanjscallan opened this issue Mar 21, 2022 · 8 comments
Open

Proposal: GraphQL Implementation #84

evanjscallan opened this issue Mar 21, 2022 · 8 comments
Assignees
Labels
help wanted Extra attention is needed status: needs discussion Discussion needed before ready to work on

Comments

@evanjscallan
Copy link
Contributor

Hey Team,

I was recently able to connect our graphQL database to NextJS with the idea of integrating back-end data live into Orcahome . The process essentially means one can take orcasite back-end data (at least with graphQL) and implement them into front-end components.

As an example, I've built a "Last Detection" component which takes a timestamp from the most recent user detection log and calculates the time between the timestamp and the current time. The idea is to ultimately increase the interactivity of orcahome by displaying live data to the end-user.

I've provided a link below demonstrating an example:

Working Example
https://compassionate-heyrovsky-7e06ad.netlify.app/

Source Code
https://github.com/evanjscallan/stylepod2

Notes:
-The top text is the last timestamp grab, while the bottom element is the actual 'Last Detection' component.
-The development was a brainstorm process so the code is fairly verbose and heavily biased towards class components at the moment.

Ideally what I'd like to do in the future is refactor the code and create an interchangeable 'layer' that devs can send their component through to grab back-end data. Making the data pull modular could save a lot of development time and D.R.Y. issues.

Let me know your thoughts, always open to ideas/critiques/improvements.

(P.S. special thanks to @paulcretu--major headache-saver)

@evanjscallan evanjscallan changed the title Proposal: GraphQL Implementations Proposal: GraphQL Implementation Mar 21, 2022
@scottveirs
Copy link
Member

Nice work, @evanjscallan ! I'd not seen the demo but observe now (finally) that it's still operational:

Screen Shot 2022-12-21 at 4 47 59 PM

That said, I think there may be a time zone and/or daylight savings math issue. Based on this time (local, Pacific) time stamp of the latest human annotation --

Screen Shot 2022-12-21 at 4 48 19 PM

-- but the time since the annotation should be closer to 6 hours, rather than the computed 17.

@evanjscallan
Copy link
Contributor Author

evanjscallan commented Dec 22, 2022 via email

@UXBrendan
Copy link

@evanjscallan - Let me know if this issue is complete, or if you need anything from me to move forward toward completion.

@evanjscallan
Copy link
Contributor Author

@UXBrendan I'll try to give this a look this week and see if I can work out the timezone issue. Will keep you posted.

@evanjscallan
Copy link
Contributor Author

evanjscallan commented Mar 12, 2023

@UXBrendan I believe I have a fix for the time zone issue through specifying UTC for the current date and date of last activity. I have also overhauled the util component and LastDetection button to accommodate typescript and allow for easier readability. Please see PR #93 for details.

If you'd like to test out the fix, you can simply add the component in the 'return' portion of Layout.tsx to view the button.

@UXBrendan UXBrendan self-assigned this Apr 3, 2023
@UXBrendan UXBrendan added help wanted Extra attention is needed status: needs discussion Discussion needed before ready to work on labels Apr 3, 2023
@UXBrendan
Copy link

Hi @evanjscallan

Just checking in with you about this issue. Let me know if you have any blockers or are done.

@evanjscallan
Copy link
Contributor Author

Hey @UXBrendan, while I don't know of any implemented frontend use for the feature, the issue should be resolved.

@evanjscallan
Copy link
Contributor Author

The issue's resolution is pending review/approval in the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed status: needs discussion Discussion needed before ready to work on
Projects
None yet
Development

No branches or pull requests

3 participants