# Membership A person **`Person`** or an organization **`Organization`** can be a member (**`Member`** union) of any organization. ## People with positions in an organization The relationship between a person and an organization is described by nodes in the following order: - **`Person`** is a person. - **`Membership`** is membership information, such as the format or period. - **`Post`** is a position in that organization. - **`Organization`** is an organization. For example, if we want to know what positions _Chuan Leekpai_ has held in which organizations. ```graphql query People($where: PersonWhere) { people(where: $where) { id name_en memberships { id label start_date end_date posts { id label organizations { id name_en name classification } } } } } ``` Variables: ```json { "where": { "firstname_en": { "eq": "Chuan" } }, "lastname_en": { "eq": "Leekpai" } } ``` [Run this query in the playground](https://politigraph.wevis.info/graphql?explorerURLState=N4IgJg9gxgrgtgUwHYBcQC4QEcYIE4CeABAAoIQAOANggBQAkA7gBb4Lqn4DOESA6qzwIAlEWAAdJESIVy1OizYcmgkWMnTpASzAbNSAIaIA+sj3TEcAEbdmWil3VTN23c5dUDNquc1cUBngoxmAGKAi+0shgIWER7poUEP6OEgkuOpGant5Z0hB4AOYGSFoAXmFavKl5mpnpLkSGJmYNLs3xjY1QnlxcWgBmWlCVvLUAvlmTCdPS0+MgADQgAG6BWl40XBggadLiIIpCBxx7mgdDeP4dpkgnTl0HCFj3BwDCzDAlB76zROOLPQHXooG5mDAPc4gZ6vEAAGQQCAA1hQDFofs55iBxkA) Because the graph database connects all nodes, we can start a query from any node. For example, if we want to know who has ever held the position of _leader_ of the _Pheu Thai Party_, we can start the query from **`Post`**. ```graphql query Posts($where: PostWhere) { posts(where: $where) { id label role organizations { id name_en name } memberships { id start_date end_date members { ... on Person { id name_en } } } } } ``` Variables: ```json { "where": { "role": { "eq": "หัวหน้าพรรคการเมือง" } }, "organizations": { "some": { "id": { "eq": "พรรคเพื่อไทย" } } } } ``` [Run this query in the playground](https://politigraph.wevis.info/graphql?explorerURLState=N4IgJg9gxgrgtgUwHYBcQC4QEcYIE4CeABAAoQDOK5AFACQDuAFvguqRSgOrN4ICURYAB0kRIgAcONJizYMe-QSLFiAlmGUqANgEMARgi2axeCFoTGiEPAHMdSVQC8dKVRCTklolWo3efSDqIAPrIlmKBiJYAvpaIcAZ45Iyq4p7C-irq4USUOngowWAuFpliyGBFJTnxiek5YgB0zVaiJPjk7l4+PUTZZT2RCKFIDUSxAxM+U+Mi0SAANCAAbvmq+ubkGCAZYkIgMrz7bLsq+6bmx909+whYV-uA1HCAjHCA5HCPgJhwgJJwgExwgHhwgGI4AGAEDhAIBwPwBgAE4QCEcIB2OEAtHCAcDh9jFNNEFpp9tY7A5nK53OQrqc9iBOlEMNcfPtshTiTcQHcHiBASDIX9YYAJOHhgBE4QDocIAiOBRk1R3gm82iQA) ## Government and Opposition parties We model "Government parties (พรรคฝ่ายรัฐบาล)" and "Opposition parties (พรรคฝ่ายค้าน)" as a **`Post`** in the cabinet organization. ```graphql query Organizations($where: OrganizationWhere, $postsWhere2: PostWhere) { organizations(where: $where) { id name_en posts(where: $postsWhere2) { id label role memberships { id start_date end_date members { ... on Organization { id name } } } } } } ``` Variables: ```json { "where": { "id": { "eq": "คณะรัฐมนตรี-63" } }, "postsWhere2": { "role": { "startsWith": "พรรคฝ่าย" } } } ``` [Run this query in the playground](https://politigraph.wevis.info/graphql?explorerURLState=N4IgJg9gxgrgtgUwHYBcQC4QEcYIE4CeABAPJ4DmAhkgJYBelKNESAzgBQAkA7gBb4J0pCtXqNmSAOr88CADRFOABwisUraQIBMQgAqqUm2QEoiwADpIiRCCNoMmLDnwFCeMhKYtXrRGmEtfIiRKRAB9ZEDfFTVnDzcY9SMELS8ooP903wAbSgAjBGys6zwIbIRiokQ4ArxWXholVjNK60yfIOs1SjwUMLBGCo7O5DB+wdaqhBr8Zu9OzoA6ZZsrMip7cRYW4YW2gN29kMRJ6wBfSYvDq6CboiuzkDkQADcemnzy1gwQeaJzEAuWQAoR-awAzIYHYLAEILAg-4gQAgcIBkOEADHCAYjhAIxwgAQ4QCEcIBMOEAqHAYwCscABaABsAGYAVk7mc5FEAYkNB4tAiwYjSuVOZUAd1ehoaCheAiAYA8OAxGKRgFw4QAScIAmOEARHB04YMyyPM5AA)