# DAG and Ref in post hook

**URL:** <https://discourse.getdbt.com/t/dag-and-ref-in-post-hook/11993>\
**Category:** Help\
**Created:** [February 10, 2024, 9:59pm UTC](https://discourse.getdbt.com/t/dag-and-ref-in-post-hook/11993 "2024-02-10T21:59:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![troflog](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@troflog](https://discourse.getdbt.com/u/troflog)\
**Post date:** [February 10, 2024, 9:59pm UTC](https://discourse.getdbt.com/t/dag-and-ref-in-post-hook/11993/1 "2024-02-10T21:59:41Z")

</div>

If I place a reference to some model X in a the post hook statement to model Y. Will model Y’s DAG also point to model X?

---

<div class="post-metadata">

**Author:** ![brunoszdl](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/brunoszdl/32/4113_2.png) [@brunoszdl](https://discourse.getdbt.com/u/brunoszdl)\
**Post date:** [February 12, 2024, 1:06pm UTC](https://discourse.getdbt.com/t/dag-and-ref-in-post-hook/11993/2 "2024-02-12T13:06:09Z")

</div>

I tested it here and yes, it will assume they are dependent

model1.sql

```auto
select 1

```

model2.sql

```auto
{{ config(
  post_hook = "select * from {{ ref('model1') }}"
) }}

select 2

```

```auto
❯ dbt run -s +model2
13:05:29 Running with dbt=1.7.3
13:05:29 Registered adapter: postgres=1.7.3
13:05:30 Found 8 models, 1 snapshot, 35 tests, 1 seed, 3 sources, 0 exposures, 0 metrics, 663 macros, 0 groups, 0 semantic models
13:05:30  
13:05:30 Concurrency: 4 threads (target='dev')
13:05:30  
13:05:30 1 of 2 START sql view model dbt_bruno.model1 ................................... [RUN]
13:05:30 1 of 2 OK created sql view model dbt_bruno.model1 .............................. [CREATE VIEW in 0.09s]
13:05:30 2 of 2 START sql view model dbt_bruno.model2 ................................... [RUN]
13:05:30 2 of 2 OK created sql view model dbt_bruno.model2 .............................. [CREATE VIEW in 0.05s]
13:05:30  
13:05:30 Finished running 2 view models in 0 hours 0 minutes and 0.31 seconds (0.31s).
13:05:30  
13:05:30 Completed successfully
13:05:30  
13:05:30 Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2

```
