Skip to content

[GraphQL] Deprecation policy

Michail Slabko edited this page Aug 26, 2020 · 3 revisions

This document describes a deprecation policy for GraphQL schema in scope of Storefront Application project

How to deal with fields deprecated in GQL?

  • GraphQL Server (NodeJS) will proxy requests to Magento to retrieve field marked as deprecated in GQL
  • Deprecated in GQL fields should not be exposed through Storefront API

How to deal with fields not present in Storefront API

  • do not expose field through Storefront API that we "don’t want to have"
  • Go with 1st option later and add field to SF or deprecate from GQL after analyze

Here some details regarding "1st" option and problem in general

problem: What options do we have to solve the problem “field X is not deprecated in GQL, but X field is not present in Storefront API”

We have only 3 options here:

  1. analyze use-cases with PWA/ECE and 1.1. if no real use-cases: deprecate field in GQL with prosing another approach 1.2. if have real use-case: add X field to Storefront API
  2. treat X field as “deprecated” and do proxy on Monolith
  3. add X field to Storefront API

We want to consider SF API as independent API which should reflect Storefront needs and not blindly copy existing GQL schema. That's why we should follow 1st option and analyze GQL fields that we don’t want to have on Storefront API and deprecate/add them only after analyzing existing use-cases