%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left


    %% plan dependencies
    Object20{{"Object[20∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Access18{{"Access[18∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access19{{"Access[19∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access18 & Access19 --> Object20
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access18
    __Value2 --> Access19
    __Value4["__Value[4∈0] ➊<br />ᐸrootValueᐳ"]:::plan
    Constant39{{"Constant[39∈0] ➊<br />ᐸ'Jane Doe'ᐳ"}}:::plan
    Constant42{{"Constant[42∈0] ➊<br />ᐸ'Unknown'ᐳ"}}:::plan
    Constant43{{"Constant[43∈0] ➊<br />ᐸ'jane.doe@example.com'ᐳ"}}:::plan
    Constant45{{"Constant[45∈0] ➊<br />ᐸ[ 'Jay Doe', 'JD' ]ᐳ"}}:::plan
    Constant46{{"Constant[46∈0] ➊<br />ᐸ§{ url: 'http://example.com' }ᐳ"}}:::plan
    PgInsertSingle17[["PgInsertSingle[17∈1] ➊<br />ᐸperson(person_full_name,aliases,about,email,site)ᐳ"]]:::sideeffectplan
    Object20 & Constant39 & Constant45 & Constant42 & Constant43 & Constant46 --> PgInsertSingle17
    Object21{{"Object[21∈1] ➊<br />ᐸ{result}ᐳ"}}:::plan
    PgInsertSingle17 --> Object21
    PgSelect31[["PgSelect[31∈3] ➊<br />ᐸfrmcdc_wrappedUrlᐳ"]]:::plan
    PgClassExpression30{{"PgClassExpression[30∈3] ➊<br />ᐸ__person__.”site”ᐳ"}}:::plan
    Object20 & PgClassExpression30 --> PgSelect31
    PgClassExpression24{{"PgClassExpression[24∈3] ➊<br />ᐸ__person__.”id”ᐳ"}}:::plan
    PgInsertSingle17 --> PgClassExpression24
    PgClassExpression25{{"PgClassExpression[25∈3] ➊<br />ᐸ__person__...full_name”ᐳ"}}:::plan
    PgInsertSingle17 --> PgClassExpression25
    PgClassExpression26{{"PgClassExpression[26∈3] ➊<br />ᐸ__person__.”aliases”ᐳ"}}:::plan
    PgInsertSingle17 --> PgClassExpression26
    PgClassExpression28{{"PgClassExpression[28∈3] ➊<br />ᐸ__person__.”about”ᐳ"}}:::plan
    PgInsertSingle17 --> PgClassExpression28
    PgClassExpression29{{"PgClassExpression[29∈3] ➊<br />ᐸ__person__.”email”ᐳ"}}:::plan
    PgInsertSingle17 --> PgClassExpression29
    PgInsertSingle17 --> PgClassExpression30
    First35{{"First[35∈3] ➊"}}:::plan
    PgSelectRows36[["PgSelectRows[36∈3] ➊"]]:::plan
    PgSelectRows36 --> First35
    PgSelect31 --> PgSelectRows36
    PgSelectSingle37{{"PgSelectSingle[37∈3] ➊<br />ᐸfrmcdc_wrappedUrlᐳ"}}:::plan
    First35 --> PgSelectSingle37
    __Item27[/"__Item[27∈4]<br />ᐸ26ᐳ"\]:::itemplan
    PgClassExpression26 ==> __Item27
    PgClassExpression38{{"PgClassExpression[38∈5] ➊<br />ᐸ__frmcdc_w...rl__.”url”ᐳ"}}:::plan
    PgSelectSingle37 --> PgClassExpression38

    %% define steps

    subgraph "Buckets for mutations/v4/rbac.createPerson"
    Bucket0("Bucket 0 (root)"):::bucket
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,__Value4,Access18,Access19,Object20,Constant39,Constant42,Constant43,Constant45,Constant46 bucket0
    Bucket1("Bucket 1 (mutationField)<br />Deps: 20, 39, 45, 42, 43, 46<br /><br />1: PgInsertSingle[17]<br />2: <br />ᐳ: Object[21]"):::bucket
    classDef bucket1 stroke:#00bfff
    class Bucket1,PgInsertSingle17,Object21 bucket1
    Bucket2("Bucket 2 (nullableBoundary)<br />Deps: 21, 17, 20<br /><br />ROOT Object{1}ᐸ{result}ᐳ[21]"):::bucket
    classDef bucket2 stroke:#7f007f
    class Bucket2 bucket2
    Bucket3("Bucket 3 (nullableBoundary)<br />Deps: 17, 20<br /><br />ROOT PgInsertSingle{1}ᐸperson(person_full_name,aliases,about,email,site)ᐳ[17]<br />1: <br />ᐳ: 24, 25, 26, 28, 29, 30<br />2: PgSelect[31]<br />3: PgSelectRows[36]<br />ᐳ: First[35], PgSelectSingle[37]"):::bucket
    classDef bucket3 stroke:#ffa500
    class Bucket3,PgClassExpression24,PgClassExpression25,PgClassExpression26,PgClassExpression28,PgClassExpression29,PgClassExpression30,PgSelect31,First35,PgSelectRows36,PgSelectSingle37 bucket3
    Bucket4("Bucket 4 (listItem)<br /><br />ROOT __Item{4}ᐸ26ᐳ[27]"):::bucket
    classDef bucket4 stroke:#0000ff
    class Bucket4,__Item27 bucket4
    Bucket5("Bucket 5 (nullableBoundary)<br />Deps: 37<br /><br />ROOT PgSelectSingle{3}ᐸfrmcdc_wrappedUrlᐳ[37]"):::bucket
    classDef bucket5 stroke:#7fff00
    class Bucket5,PgClassExpression38 bucket5
    Bucket0 --> Bucket1
    Bucket1 --> Bucket2
    Bucket2 --> Bucket3
    Bucket3 --> Bucket4 & Bucket5
    end
