[ git ] revert PR, then move all the PR branch content to the new branch

  1. Create patch file that contains a diff between 2 branch
git diff develop..link-to-category-page > link-to-category-page.patch

2) Create new branch and apply patch to new branch

git apply link-to-category-page.patch

 

ref : https://gist.github.com/patkujawa-wf/9960173

, https://stackoverflow.com/questions/24922094/taking-a-git-diff-and-creating-a-new-branch-in-different-repo/24922587#comment38724313_24922094

[ GraphQL ] schema

way1: get schema using graphQL

Example payload that get all the schema types

{
  __schema {
    types {
      kind
      name
      possibleTypes {
        name
     }
  }
}
}

Example payload to get all fields of Post type

{
  __type(name: "Post") {
    name
      fields {
        name
        type {
          name
          kind
        }
     }
  }
}

Example response

{
  "data": {
    "__type": {
      "name": "Post",
      "fields": [
        {
           "name": "sys",
           "type": {
           "name": null,
           "kind": "NON_NULL"
         }
      },
     {
        "name": "linkedFrom",
        "type": {
          "name": "PostLinkingCollections",
          "kind": "OBJECT"
        }
    },
    {
      "name": "publishDate",
      "type": {
        "name": "DateTime",
        "kind": "SCALAR"
      }
    },
  {
    "name": "title",
    "type": {
      "name": "String",
      "kind": "SCALAR"
    }
  },
  {
    "name": "categoriesCollection",
    "type": {
      "name": "PostCategoriesCollection",
      "kind": "OBJECT"
    }
  },
  {
    "name": "series",
    "type": {
      "name": "Series",
      "kind": "OBJECT"
    }
  },
  {
    "name": "image",
    "type": {
      "name": "Asset",
      "kind": "OBJECT"
    }
  },
  {
    "name": "tags",
    "type": {
      "name": null,
      "kind": "LIST"
    }
  }
  ]
 }
}
}

ref : https://graphql.org/learn/introspection/
way2 : get schema using graphql-cli

npm install -g graphql-cli

graphql get-schema

ref : https://gist.github.com/nikolasburk/7dbe73758d68d09001ff3c1da8f1826f