<p>To get the field value from you entries you need do some inline fragment on the entries type interface you can refer to <a href="https://craftcms.com/docs/4.x/graphql.html#interface-implementation" rel="nofollow noreferrer">https://craftcms.com/docs/4.x/graphql.html#interface-implementation</a></p>
<p>So, it should look like this</p>
<pre><code>{
  entries (section: &quot;blogPosts&quot;){ 
  title 
  ... on blog_posts_Entry {
    body
    fieldA
    fieldB 
 }
} 
</code></pre>
<p>the blog_posts_Entry is called interface, you can found the correct value in your schema.</p>

CC BY-SA 4.0
2022-12-08T16:42:49.163Z
Thanks, @aodihis. 
I've tried this but my call still isnt returning anything and doesnt even know the fieldA or fieldB as available in the schema that was fetched. 

Is there something specific that needs to be checked off in the schema in addition to the entries section? e.g. the "View Category Group" in the schema definition?
Adrienne W
CC BY-SA 4.0
2022-12-09T07:27:02.547Z
@AdrienneW for schema, do you use full schema or you create new one? if you created new one, do you have set your entry type to given schema? if it is possible can you give us screenshot about your field and schema.
aodihis
CC BY-SA 4.0
2022-12-14T16:07:51.517Z
I created a new schema. I have included all of the Entries sections that I am looking to query (including everything for my Blog entry type). But I haven't included any of the "View Category group" under the Categories element.
Adrienne W
CC BY-SA 4.0
2022-12-07T02:57:39.753Z
2022-12-07T02:57:39.753Z
aodihis
<p>I am fairly new to Craft; I have an entry type with a custom field that is a Categories field. I am trying to use GraphQL to return the fields on my entry, including the category field value.
Ex. my Blog Post entries have a custom category field of blogType. Ideally, I want my data to be like this</p>
<pre><code>{
&quot;data&quot;: {
    &quot;entries&quot;: [
        {
            &quot;title&quot;: &quot;Blog 1&quot;,
            &quot;body&quot;: &quot;&lt;STRING&gt;&quot;
            &quot;blogType&quot;: &quot;Announcement&quot;
        },
        {
            &quot;title&quot;: &quot;Blog 2&quot;,
            &quot;body&quot;: &quot;&lt;STRING&gt;&quot;
            &quot;blogType&quot;: &quot;Marketing&quot;
        },
        {
            &quot;title&quot;: &quot;Blog 3&quot;,
            &quot;body&quot;: &quot;&lt;STRING&gt;&quot;
            &quot;blogType&quot;: &quot;News&quot;
        }
</code></pre>
<p>I have tried a lot of variations of my query but cannot seem to return the field value for each entry. Here are some of the queries I have tried</p>
<pre><code>{
entries (section: &quot;blogPosts&quot;){ 
title 
body
blogType
} 
</code></pre>
<p>and the below query trying to use label, value, title, group and probably a lot more.</p>
<pre><code>{
entries (section: &quot;blogPosts&quot;){ 
title 
body
blogType { label }
}
</code></pre>

<entries><field><custom-fieldtype><graphql>
Fetch Category Field Value on Entry Element
# Fetch Category Field Value on Entry Element

(Asked by: username_0 on 2022-12-06)

I am fairly new to Craft; I have an entry type with a custom field that is a Categories field. I am trying to use GraphQL to return the fields on my entry, including the category field value.
Ex. my Blog Post entries have a custom category field of blogType. Ideally, I want my data to be like this
{
"data": {
    "entries": [
        {
            "title": "Blog 1",
            "body": ""
            "blogType": "Announcement"
        },
        {
            "title": "Blog 2",
            "body": ""
            "blogType": "Marketing"
        },
        {
            "title": "Blog 3",
            "body": ""
            "blogType": "News"
        }

I have tried a lot of variations of my query but cannot seem to return the field value for each entry. Here are some of the queries I have tried
{
entries (section: "blogPosts"){ 
title 
body
blogType
} 

and the below query trying to use label, value, title, group and probably a lot more.
{
entries (section: "blogPosts"){ 
title 
body
blogType { label }
}

**Tags:** entries, field, custom-fieldtype, graphql

---

## 1 answers

### Answer by username_1 on 2022-12-07. Score: 1

To get the field value from you entries you need do some inline fragment on the entries type interface you can refer to https://craftcms.com/docs/4.x/graphql.html#interface-implementation
So, it should look like this
{
  entries (section: "blogPosts"){ 
  title 
  ... on blog_posts_Entry {
    body
    fieldA
    fieldB 
 }
} 

the blog_posts_Entry is called interface, you can found the correct value in your schema.

> **Comments:**
> **username_0**: Thanks, @aodihis.  I've tried this but my call still isnt returning anything and doesnt even know the fieldA or fieldB as available in the schema that was fetched.   Is there something specific that needs to be checked off in the schema in addition to the entries section? e.g. the "View Category Group" in the schema definition?  
> **username_1**: @AdrienneW for schema, do you use full schema or you create new one? if you created new one, do you have set your entry type to given schema? if it is possible can you give us screenshot about your field and schema.  
> **username_0**: I created a new schema. I have included all of the Entries sections that I am looking to query (including everything for my Blog entry type). But I haven't included any of the "View Category group" under the Categories element.  

---

