robmarshall / gatsby-source-gravityforms Goto Github PK
View Code? Open in Web Editor NEWGatsby source plugin to add WordPress Gravity Forms nodes to your app.
License: GNU General Public License v3.0
Gatsby source plugin to add WordPress Gravity Forms nodes to your app.
License: GNU General Public License v3.0
Basic auth needs adding, so backend site can have another layer of security.
Details to be added in Gatsby config. Append to the front of REST API URLs
The "choices" fields under "fieldNames" are not converting into GraphQL nodes. Currently being stringified as a work around.
One of our developers had this error come up. It turns out it was caused by having an inaccurate time set in Windows 10.
I couldn't find anyone else with this error but I looked through the axios.js file and saw you are using Date().getTime() to send the oauth_timestamp. After he synced his time in Windows the error went away.
I'm not sure if WP or the GF API sends back anything about a wrong oauth_timestamp, but if it does it would be super helpful to show this in the terminal.
At the very least I thought it would be good to post about it in case anyone else runs into this error.
Error: Error 401 from GravityForms API
- axios.js:110 apiErrorHandler
/[gatsby-source-gravityforms]/utils/axios.js:110:71
- axios.js:33 getForms
/[gatsby-source-gravityforms]/utils/axios.js:33:5
- task_queues.js:93 processTicksAndRejections
internal/process/task_queues.js:93:5
- axios.js:72 getFormsAndFields
/[gatsby-source-gravityforms]/utils/axios.js:72:18
- gatsby-node.js:63 Object.exports.sourceNodes
/[gatsby-source-gravityforms]/gatsby-node.js:63:18
- api-runner-node.js:434 runAPI
/[gatsby]/src/utils/api-runner-node.js:434:16
I'm trying to set up gatsby-source-gravityforms but get 403 error status but can't understand why.
Configurations I tried:
{
resolve: 'gatsby-source-gravityforms',
options: {
baseUrl: `${process.env.WORDPRESS_PROTOCOL}://${process.env.WORDPRESS_BASE_URL}`,
api: {
key: process.env.GRAVITY_FORMS_KEY,
secret: process.env.GRAVITY_FORMS_SECRET,
},
},
},
{
resolve: 'gatsby-source-gravityforms',
options: {
baseUrl: `${process.env.WORDPRESS_PROTOCOL}://${process.env.WORDPRESS_BASE_URL}`,
api: {
key: process.env.GRAVITY_FORMS_KEY,
secret: process.env.GRAVITY_FORMS_SECRET,
},
basicAuth: {
username: process.env.WORDPRESS_USER,
password: process.env.WORDPRESS_PASSWORD,
},
},
},
Access to API is enabled, the key is generated correctly and added to .env
:
Error in the terminal:
gatsby-source-gravityforms
version is 1.0.13
.
Any ideas why it works like that? And why is expires
value is 'Wed, 11 Jan 1984 05:00:00 GMT'
?
Looks like there's an issue with the schema here. I have reason to believe this is causing issues with my gatsby cloud builds, but I thought I'd reach out first. Thanks!
If you have explicitly defined a type for those fields, you can safely ignore this warning message.
Otherwise, Gatsby will omit those fields from the GraphQL schema.
If you know all field types in advance, the best strategy is to explicitly define them
with the `createTypes` action, and skip inference with the `@dontInfer` directive.
See https://www.gatsbyjs.org/docs/actions/#createTypes
GF__Form.confirmations.pageId:
- type: number
value: 0
- type: string
value: ''
GF__Form.formFields.rangeMin:
- type: boolean
value: false
- type: string
value: ''
GF__Form.formFields.rangeMax:
- type: boolean
value: false
- type: string
value: ''
Hey Rob,
Closed our other issue, and right now chewing on the GraphiQL and curious why the field "content" is missing. The rest of the query validates with the exception of the field for "content".
Ideas?
Cheers,
Travis
Right now can't see how to get conditionalLogic for formFields :(
Pretty sure it does exist, I checked it in docs
I wouldn't even mind helping with PR to speed up the process if you wouldn't mind helping me with pointing out where to do it :)
Hi there,
I recently converted an old WP site to Gatsby and encountered field type conflicts when I imported old forms and mixed them with new ones, causing the plugin to omit those fields entirely.
Apparently GF changed the field types over time (i.e. field id was a string value at some point and now it's an integer). I contacted GF support and they've helped me out super quickly and I thought you want to mention this solution in your documentation in case anyone else is facing the same issues.
This goes into your functions.php:
add_filter( 'gform_form_post_get_meta', function ( $form ) {
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
foreach ( $form['fields'] as &$field ) {
if ( isset( $field->id ) ) {
$field->id = (int)$field->id;
}
}
}
return $form;
} );
I'm having an issue during builds on Gatsby Cloud where the build fails while trying to fetch the form data. This error does not occur during a gatsby-develop
. Only during a full build.
Here's the output from Gatsby:
verbose 121.205364957 Fetching form ids
16:30:30 PM:
ERROR Request was made, but there was an issue Error 401 from GravityForms API
16:30:30 PM:
Error: Error 401 from GravityForms API
16:30:30 PM:
16:30:30 PM:
- axios.js:110 apiErrorHandler
16:30:30 PM:
16:30:30 PM:
16:30:30 PM:
[www]/[gatsby-source-gravityforms]/utils/axios.js:110:71
16:30:30 PM:
- axios.js:33 getForms
16:30:30 PM:
- runMicrotasks
16:30:30 PM:
internal/process/task_queues.js:97:5
16:30:30 PM:
[www]/[gatsby-source-gravityforms]/utils/axios.js:33:5
16:30:30 PM:
- task_queues.js:97 processTicksAndRejections
16:30:30 PM:
16:30:30 PM:
16:30:30 PM:
16:30:30 PM:
16:30:30 PM:
not finished source and transform nodes - 113.700s
Here's the Gravity Forms API log output:
2021-06-02 16:32:59.244479 - ERROR --> GF_REST_Authentication::set_error(): {"errors":{"gform_rest_authentication_error":["Invalid signature - provided signature does not match."]},"error_data":{"gform_rest_authentication_error":{"status":401}}}
There are currently installation procedures that appear to suggest that using this plugin is as easy as installing the package and adding the config to gatsby-config.js. However, the presence of the src/
folder and .babelrc suggest a transpile step.
Can you elaborate on those?
Currently forms are created within a loop as one node.
The outcome is the ability to query by essential values such as slug,
Consider examples in:
https://www.gatsbyjs.org/docs/actions/#createNode
https://www.gatsbyjs.org/docs/actions/#createTypes
You reference gatsby-gravityforms-components
(plural) several times in your readme, but It looks like your package is singular npm i gatsby-gravityforms-component
Thank you for this project! I'm trying to implement it now on a project, hopefully this will work otherwise I'll need to explore Netlify forms. If i had the luxury of time I'd help you out with this!
Confirmations are currently allocated to all forms, and the user needs to loop through to find the confirmation with data.
It would be better to have the confirmations added as an array, and for the correct forms. This way they can be implemented quickly.
File in: /src/utils/processForms.js
Ignore fields currently outlines the fields to skip as an array, but would be cleaner and allow the user to target more levels if it were an object.
Would it be possible to get a full example? Basically just an implementation that shows the proper parsing of the choices and the proper way of submitting the form etc. Been failing at the choices for a while now so figured a full blown example would be more helpful in general than just my particular issues.
Error trying to deploy to Netlify
5:27:03 PM: error Cannot find module './0AuthParameters'
5:27:03 PM: Error in "/opt/build/repo/node_modules/gatsby-source-gravityforms/gatsby-node.js": Cannot find module './0AuthParameters'
5:27:03 PM: See our docs page for more info on this error: https://gatsby.dev/issue-how-to
5:27:03 PM:
5:27:03 PM: Error: Cannot find module './0AuthParameters'
/utils/axios.js
const _require3 = require('./0AuthParameters'),
0authParameters.js
Because right now fetching reCAPTCHA makes no sense if you can't get Site Key. Yes, you can store it in .env
variables but what's the point if it already exists in Gravity Forms settings? Or there is no way to get it?
Howdy,
I'm building a proof of concept for a client, and we'll be leaning pretty heavily on Gravity Forms. Your plugin has been implemented, but on build there's an error saying, "Cannot read property 'split' of undefined".
Config options are set according to your documentation, so a little lost as to what the "split" is and why it's creating conflict.
Thanks in advance.
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.