{"id":28920222,"url":"https://github.com/wp-graphql/wp-graphql-fieldmanager","last_synced_at":"2025-06-22T04:13:00.250Z","repository":{"id":83806692,"uuid":"95888975","full_name":"wp-graphql/wp-graphql-fieldmanager","owner":"wp-graphql","description":"GraphQL bindings for WordPress Fieldmanager, by Alley Interactive","archived":false,"fork":false,"pushed_at":"2017-07-03T22:27:05.000Z","size":3528,"stargazers_count":6,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-10T05:02:22.700Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wp-graphql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-06-30T13:03:27.000Z","updated_at":"2024-09-16T23:10:35.000Z","dependencies_parsed_at":"2023-06-03T05:30:55.407Z","dependency_job_id":null,"html_url":"https://github.com/wp-graphql/wp-graphql-fieldmanager","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"cbeb5cfef646786ba16df68eaf862f690db8aa02"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wp-graphql/wp-graphql-fieldmanager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-fieldmanager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-fieldmanager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-fieldmanager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-fieldmanager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wp-graphql","download_url":"https://codeload.github.com/wp-graphql/wp-graphql-fieldmanager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wp-graphql%2Fwp-graphql-fieldmanager/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260917282,"owners_count":23082325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-22T04:12:54.071Z","updated_at":"2025-06-22T04:13:00.231Z","avatar_url":"https://github.com/wp-graphql.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WPGraphQL Fieldmanager\n\nWPGraphQL bindings for WordPress Fieldmanager, by Alley Interactive. \n\n![Example of WPGraphQL Fieldmanager in action](https://github.com/wp-graphql/wp-graphql-fieldmanager/blob/master/img/fieldmanager-graphql.gif?raw=true \"WPGraphQL Fieldmanager Gif example\")\n\n## Getting Started\n\nThis plugin is an extension to both WPGraphQL and WordPress Fieldmanager and requires both of those plugins to be installed\nto work properly. \n\n### Install the plugin\n\nDownload or clone the plugin from Github and put in your WordPress plugins directory and activate the plugin.\n\n## Connect Fieldmanager Schema to WPGraphQL\n\nLet's say you have this existing Fieldmanager Config to add some fields to the \"post\" post_type: \n\n```\nadd_action( 'fm_post_post', function() {\n\n    $fm = new Fieldmanager_Group( array(\n\t\t'name' =\u003e 'contact_information',\n\t\t'children' =\u003e array(\n\t\t\t'name' =\u003e new Fieldmanager_Textfield( 'Name' ),\n\t\t\t'phone' =\u003e new Fieldmanager_Textfield( 'Phone Number' ),\n\t\t\t'website' =\u003e new Fieldmanager_Link( 'Website' ),\n\t\t\t'sub_group' =\u003e new Fieldmanager_Group([\n\t\t\t\t'name' =\u003e 'sub_group',\n\t\t\t\t'label' =\u003e __( 'Sub Group', 'wp-graphql-fieldmanager' ),\n\t\t\t\t'serialize_data' =\u003e false,\n\t\t\t\t'add_to_prefix'  =\u003e false,\n\t\t\t\t'children' =\u003e [\n\t\t\t\t\t'sub_group_field' =\u003e new Fieldmanager_TextField( 'Sub Group Field' ),\n\t\t\t\t\t'another_sub_group' =\u003e new Fieldmanager_Group([\n\t\t\t\t\t\t'name' =\u003e 'another_sub_group',\n\t\t\t\t\t\t'children' =\u003e [\n\t\t\t\t\t\t\t'another_sub_group_text_field' =\u003e new Fieldmanager_TextField( 'Another Sub Group Field' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t]),\n\t\t\t\t],\n\t\t\t]),\n\t\t),\n\t) );\n\n\t$fm-\u003eadd_meta_box( 'Contact Information', 'post' );\n\n}\n```\n\nSimply update the last line to be: \n\n```\n$fm_config = $fm-\u003eadd_meta_box( 'Contact Information', 'post' );\n\\WPGraphQL\\Extensions\\Fieldmanager::add_fields( $fm_config );\n```\n\nAnd now the `post` post_type will have the defined fields in the WPGraphQL Schema. \n\n**NOTE:** This will add all fields in the configuration to the WPGraphQL Schema. There will likely be per-field `show_in_graphql` support at some point in the future.\n\n## Query Fieldmanager fields\n\nOnce your fields are connected to WPGraphQL, they will show in your GraphQL Schema and you can query them. \n\nUsing the examples above, we have 2 fields connected to the root of the \"post\" type: `demo_field` and `contact_information`, \nwhere `demo_field` is a single field and `contact_information` is a field group.\n \nNow, we can run a query like so: \n\n```\n{\n  post(id: \"{post_global_id_goes_here}\") {\n    id\n    postId\n    contactInformation {\n      name {\n        value\n      }\n      phone {\n        value\n      }\n      website {\n        value\n      }\n      subGroup{\n        subGroupField{\n          value\n        }\n        anotherSubGroup{\n          anotherSubGroupTextField{\n            value\n          }\n        }\n      }\n    }\n    demoField {\n      value\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-graphql%2Fwp-graphql-fieldmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwp-graphql%2Fwp-graphql-fieldmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwp-graphql%2Fwp-graphql-fieldmanager/lists"}