Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/dazza-dev/sw-wpforms-graphql/archive/refs/heads/main.zipExposes WPForms form structure via WPGraphQL and provides a REST endpoint for headless form submissions.
Description
This plugin enables headless WordPress form handling by exposing WPForms form structure through WPGraphQL and providing a REST API endpoint for form submissions.
GraphQL Query — Fetch form structure:
{ wpForm(id: 123) { id title submitText fields { id type label placeholder required cssClass choices { label value } format } } }
REST API — Submit form entries:
` POST /wp-json/sw/v1/forms/{form_id}/submit Content-Type: application/json
{ "fields": { "1": "John", "2": "Doe", "3": "john@example.com" } } `
Features:
- Exposes form fields with type, label, placeholder, required, CSS classes, and choices
- Supports all WPForms field types (text, email, phone, textarea, select, radio, checkbox, GDPR)
- CSS class passthrough (
wpforms-one-half, etc.) for frontend layout control - Submit button text exposed via
submitTextfield - Server-side validation for required fields and email format
- Triggers WPForms notifications (emails) on successful submission
- Entries saved to WPForms for admin review
Requirements
Installation
- Upload the
sw-wpforms-graphqlfolder to/wp-content/plugins/ - Activate the plugin through the "Plugins" menu in WordPress
- Create forms in WPForms and use their IDs in GraphQL queries
Changelog
1.0.0
- Initial release
- GraphQL query for form structure
- REST API endpoint for form submissions
- Server-side field validation
- WPForms notification triggering