dschau / gatsby-mail Goto Github PK
View Code? Open in Web Editor NEWA Gatsby email *application*
Home Page: https://gatsby-mail.netlify.com
License: MIT License
A Gatsby email *application*
Home Page: https://gatsby-mail.netlify.com
License: MIT License
Just finished watching the webinar and checking out your example Gatsby web app.
Under the readme's setup instruction it lists to request/create a Github Token. However it might be helpful to include what scope(s) are necessary to include for this Github Token.
Thanks
Add pagination and use client-side routes to do (for instance) pages/2, pages/3, etc.
Probably load about 100 or so per page
I just follow the setup, didn't change anything else.
error Plugin gatsby-source-graphql returned an error
...
ServerError: Response not successful: Received status code 401
...
error GraphQL Error Unknown field `github` on type `Query`
file: [path]/gatsby-mail/src/components/footer.js
1 |
2 | query FooterQuery {
> 3 | github {
| ^
4 | repository(owner: "dschau", name: "gatsby-mail") {
5 | stargazers {
6 | totalCount
7 | }
8 | }
9 | }
10 | site {
11 | siteMetadata {
12 | repository {
13 | url
ERROR Failed to compile with 1 errors 12:14:17 AM
error in ./src/components/footer.js
Module Error (from ./node_modules/eslint-loader/index.js):
[path]/gatsby-mail/src/components/footer.js
58:11 error Cannot query field "github" on type "Query" graphql/template-strings
โ 1 problem (1 error, 0 warnings)
@ ./src/layouts/index.js 19:0-42 71:42-48
@ ./node_modules/gatsby-plugin-layout/wrap-page.js
@ ./node_modules/gatsby-plugin-layout/gatsby-browser.js
@ ./.cache/api-runner-browser-plugins.js
@ ./.cache/api-runner-browser.js
@ ./.cache/app.js
@ multi (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false ./.cache/app
macOS Mojave
I'm not even 100% sure how to implement this technically on first glance (e.g. with CSS in JS) so this is a fun one!
See Paul Miller - Using Dark Mode in CSS for some more info!
Hi,
I copied the .env.sample file to a .env.development one and added my github token to GITHUB_API_TOKEN.
But when I run gatsby develop, I still get the following error:
"gatsby-source-graphql" threw an error while running the sourceNodes lifecycle:
Response not successful: Received status code 401
In my browser, I still can't access the env variables (GITHUB_API_TOKEN and GATSBY_OG_APP_ID).
Am I meant to add some plugins like webpack / define to get gatsby-mail work?
I had been looking for an Apollo example for gatsby when I came across this. Good stuff. Interesting OG service too. Checking it out for a project.
Installing and running out of the box crashes with the error TypeError: getNodesByType is not a function
. Similar to gatsbyjs/gatsby#9533, updating gatsby from 2.0.19 to latest seems to fix the error.
As installed, Google won't let you authenticate to gatsby-mail. Unlike in the webinar, there is no link to get around the scary warning.
My workaround was to sign up for my own OneGraph account, create an app, and use that App Id for GATSBY_OG_APP_ID in .env.development. In the OneGraph App dashboard I added http://localhost:8000 to CORS Origins, and then I was able to use run and use gatsby-mail locally.
When querying for messages/emails, the payload field is empty, so I can't display subject, sender, etc.
Something with OneGraph? Here's the query:
query {
google {
gmail {
messages(maxResults: 50) {
messages {
id
payload {
body {
data
}
from
to
subject
}
}
}
}
}
}
in my testing the entire payload is null, so can't even infer from
, to
, etc. etc.
cc @jlengstorf
When sending a sendMessage mutation, the GraphQL API exposed by OneGraph fails with
{
"error": {
"errors": [
{
"domain": "global",
"reason": "insufficientPermissions",
"message": "Insufficient Permission"
}
],
"code": 403,
"message": "Insufficient Permission"
}
}
CASE
disabled Gmail API
ISSUE
onegraph response not handled on UI
{"errors":[{"message":"Unexpected code 403 from Google. Response body: {\n \"error\": {\n \"code\": 403,\n \"message\": \"Gmail API has not been used in project 861228239640 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/gmail.googleapis.com/overview?project=861228239640 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.\",\n \"errors\": [\n {\n \"message\": \"Gmail API has not been used in project 861228239640 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/gmail.googleapis.com/overview?project=861228239640 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.\",\n \"domain\": \"usageLimits\",\n \"reason\": \"accessNotConfigured\",\n \"extendedHelp\": \"https://console.developers.google.com\"\n }\n ],\n \"status\": \"PERMISSION_DENIED\"\n }\n}\n","path":["google","gmail","queryThreads"]}],"data":null}
SOLUTION
1 . add details to README
API link https://console.developers.google.com/apis/library/gmail.googleapis.com
src/pages/index.js
{data && data.google && ( <MessageList css={{ paddingBottom: 24 }} threads={data.google.gmail.queryThreads.threads} /> )}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.