{"id":19697166,"url":"https://github.com/janit/ez-platform-graphql-slides","last_synced_at":"2026-05-16T03:02:52.197Z","repository":{"id":69358400,"uuid":"122494936","full_name":"janit/ez-platform-graphql-slides","owner":"janit","description":"GraphQL APIs with eZ Platform, a Symfony CMS - slides","archived":false,"fork":false,"pushed_at":"2018-02-24T18:59:42.000Z","size":3660,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T03:37:23.633Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/janit.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-22T15:09:56.000Z","updated_at":"2022-07-30T07:30:29.000Z","dependencies_parsed_at":"2023-02-22T20:45:21.083Z","dependency_job_id":null,"html_url":"https://github.com/janit/ez-platform-graphql-slides","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janit%2Fez-platform-graphql-slides","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janit%2Fez-platform-graphql-slides/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janit%2Fez-platform-graphql-slides/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janit%2Fez-platform-graphql-slides/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janit","download_url":"https://codeload.github.com/janit/ez-platform-graphql-slides/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241008033,"owners_count":19893092,"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":"2024-11-11T19:37:23.847Z","updated_at":"2026-05-16T03:02:47.177Z","avatar_url":"https://github.com/janit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL APIs\u003cbr /\u003e with eZ Platform\u003cbr /\u003eSymfony CMS\n\n\u003ccenter\u003e\u003csmall\u003eeZ Meetup Oslo\u003cbr /\u003eFebruary 22nd 2018 - Jani Tarvainen\u003c/small\u003e\u003c/center\u003e\n\n---\n\n## Agenda\n\n - GraphQL introduction\n - GraphQL with eZ Platform\n - GraphQL caveats\n - Headless site example using Next.js\n\n---\n\n# GraphQL introduction\n\n--\n\n## GraphQL introduction\n\n- Under the \u003ca href=\"http://graphql.org\"\u003eGraphQL\u003c/a\u003e umbrella:\n  - A communications protocol\n  - A Query Language\n  - Server implementations\n  - Client implementations\n- Timeline:\n  - Used at Facebook since 2012\n  - Public release in 2015\n  - Gaining momentum in 2017\n- Notable \u003ca href=\"http://graphql.org/users/\"\u003eadopters\u003c/a\u003e: GitHub, Pinterest, Neo4j,\u003cbr /\u003e Shopify, New York Times, Sky, Twitter, Yelp…\n\n--\n\n## GraphQL introduction\n\n- An alternative to RESTful APIs\n  - GraphQL independent of protocol,\u003cbr /\u003e\n    Not using on HTTP verbs (POST, GET…)\n  - REST is an architectural pattern\u003cbr /\u003e\n  GraphQL is a specification\n- GraphQL APIs are strongly typed\n- Self-documenting\n  - You WILL need to write descriptions ;)\n\n--\n\n## GraphQL with PHP \u0026amp; Symfony\n\n- Reference implementation in JavaScript\n- Two mature PHP implementations:\n  - \u003ca href=\"https://github.com/webonyx/graphql-php\"\u003eWebOnyx GraphQL library\u003c/a\u003e\n  - \u003ca href=\"https://github.com/Youshido/GraphQL\"\u003eYoushido GraphQL library\u003c/a\u003e\n- Both solid and feature complete\n- Symfony integrations:\n   - \u003ca href=\"https://github.com/overblog/GraphQLBundle\"\u003eOverBlog GraphQL Bundle\u003c/a\u003e\n   - \u003ca href=\"https://github.com/Youshido/GraphQLBundle\"\u003eYoushido GraphQL Bundle\u003c/a\u003e\n- More: \u003ca href=\"https://symfony.fi/entry/state-of-graphql-php-libraries-and-symfony-integrations-in-2017\"\u003eGraphQL, PHP and Symfony\u003c/a\u003e\n\n--\n\n## GraphQL client libraries\n\n - You can use raw HTTP\n - Libs provide\n   - Convenience\n   - Client side caching\n   - Security (Phear the dreaded GraphQL Injection)\n - Notable browser / Node.js libraries     \n   - \u003cimg src=\"./img/urql-logo.png\" alt=\"Urql\" style=\"max-height:150px; display:inline-block;float:right;\" /\u003e \u003ca href=\"https://code.facebook.com/posts/1362748677097871/relay-modern-simpler-faster-more-extensible/\"\u003eRelay Modern\u003c/a\u003e\n   - \u003ca href=\"https://www.apollographql.com\"\u003eApollo\u003c/a\u003e\n   - \u003ca href=\"https://github.com/FormidableLabs/urql\"\u003eUrql\u003c/a\u003e\n\n\n\n---\n\n# GraphQL with\u003cbr /\u003eeZ Platform\n\n--\n\n## GraphQL for CMS\n\n- CMS has a lot of complexity (content types, permissions, relations, content rendering…)\n- A generic protocol, not CMS specific\n- Queries are application specific\n- Developer friendly for queries (reads)\n- Colocation of \u003ca href=\"https://twitter.com/velmu/status/911839955718213632\"\u003equeries and template\u003c/a\u003e 😱\n\n--\n\n## GraphQL and eZ Platform\n\n - eZ Platform does not ship with GraphQL support\n - That won't stop you:\n   - Use the eZ Platform GraphQL Bundle\n   - Integrate using a Symfony GraphQL bundle\n   - Roll your own GraphQL server (please don't!)\n\n--\n\n## eZ Platform GraphQL Bundle\n\n- An experimental bundle from October 2016\n- Not maintained, but it's mostly glue code ¯\\\\_(ツ)_/¯\n- I \u003ca href=\"https://github.com/janit/ezplatform-graphql-bundle\"\u003eforked it\u003c/a\u003e to run with \u003ca href=\"https://ezplatform.com/Blog/eZ-Platform-2.0-and-1.13-have-arrived\"\u003eeZ Platform v2\u003c/a\u003e\n- Integrates the OverBlog GraphQL Bundle to repo\n- A decent feature list:\n  - Query content, location and users\n  - Search content, list location children…\n- \u003ca href=\"https://master-7rqtwti-dyxa6s2xeqt7y.eu.platform.sh/graphiql\"\u003eGraphiQL shell\u003c/a\u003e\n\n--\n\n## A simple example query\n\n- eZ Platform specific example\n```\n{\n    locationChildren(id: 2) {\n      content {\n        name\n      }\n    }\n}\n```\n- Gets location children's name property for location 2\n\n--\n\n## Integrate using\u003cbr /\u003ea Symfony GraphQL bundle\n\n- Install a generic GraphQL Bundle\n- Both OverBlog and Youshido are solid\n  - OverBlog focusing on Symfony 4 + Flex now\n  - Similar functionality and lingo\n- You will need to:\n  - Configure schema (with types)\n  - Create resolver (to resolve queries from content repo)\n- \u003ca href=\"https://symfony.fi/entry/adding-a-graphql-api-to-your-symfony-flex-app\"\u003eAdding GraphQL API to your Symfony Flex app\u003c/a\u003e\n\n--\n\n## My recommendations\n\n- For tinkering:\n  - Use the eZ Platform GraphQL Bundle\n  - It works great, but there might be issues\n  - You can \u003ca href=\"https://janit.iki.fi/ez-rest-graphql/#/5\"\u003eextend it with your queries\u003c/a\u003e\n- For production:\n  - Create your own GraphQL Bundle integration\n  - Exact control of what you expose\n  - A generic framework to expose QueryTypes?\n\n--\n\n## GraphQL Caveats\n\n- You're exposing an generic for users to query\n  - Users may find things that they shouldn't\n  - Users could cause load by \u003ca href=\"http://graphql-ruby.org/queries/complexity_and_depth.html\"\u003ecomplex or deep queries\u003c/a\u003e\n- HTTP caching not trivial\n  - Everything's a POST in most client libraries\n  - Even GETs can be very different\n- Vulnerable to \"GraphQL injections\"\n  - Client libraries sanitize input\n- It's just one tool - There's a time and place for it\n\n---\n\n# Headless site example using Next.js\n\n--\n\n- A sample decoupled site built with the\u003cbr /\u003euniversal JavaScript framework \u003ca href=\"https://react-etc.net/entry/next-js-is-the-universal-react-framework-you-ve-been-looking-for\"\u003eNext.js\u003c/a\u003e:\n\n - https://react.nu/\n - https://github.com/janit/decoupled-cms-nextjs-graphql\n - https://v1-11-hbgl5gq-oiiukjqgkij7e.eu.platform.sh/graphiql\n - https://janit.iki.fi/cms-graphql-nextjs/\n - https://www.youtube.com/watch?v=efoeIz9xTDs\n\n---\n\n# Thank you\n\n- Questions?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanit%2Fez-platform-graphql-slides","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanit%2Fez-platform-graphql-slides","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanit%2Fez-platform-graphql-slides/lists"}