<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shruti Pahuja</title>
    <description>The latest articles on DEV Community by Shruti Pahuja (@shruti_pahuja_77c64463e8e).</description>
    <link>https://dev.to/shruti_pahuja_77c64463e8e</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2101690%2F3b403614-2d99-4b5b-a372-70d17832c42b.png</url>
      <title>DEV Community: Shruti Pahuja</title>
      <link>https://dev.to/shruti_pahuja_77c64463e8e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shruti_pahuja_77c64463e8e"/>
    <language>en</language>
    <item>
      <title>Default value for field with @include directive</title>
      <dc:creator>Shruti Pahuja</dc:creator>
      <pubDate>Fri, 20 Sep 2024 11:36:17 +0000</pubDate>
      <link>https://dev.to/shruti_pahuja_77c64463e8e/default-value-for-field-with-include-directive-2me</link>
      <guid>https://dev.to/shruti_pahuja_77c64463e8e/default-value-for-field-with-include-directive-2me</guid>
      <description>&lt;p&gt;I have a requirement of adding a &lt;a class="mentioned-user" href="https://dev.to/include"&gt;@include&lt;/a&gt; directive for querying a field in a particular fragment. &lt;/p&gt;

&lt;p&gt;This fragment is being used across different queries in multiple modules so I'm having to inject a value for this field from each of these queries. I&lt;/p&gt;

&lt;p&gt;Is there any way to assign a default value to a directive at the site of the directive?&lt;/p&gt;

&lt;p&gt;&lt;code&gt;fragment sampleFragment on SampleFragment {&lt;br&gt;
    // want to assign a default value here&lt;br&gt;
    fragmentSample @include(if: $condition) {&lt;br&gt;
        // code here &lt;br&gt;
    }&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

</description>
      <category>graphql</category>
    </item>
  </channel>
</rss>
