# Fragment doesn't return data in react application

**URL:** <https://community.apollographql.com/t/fragment-doesnt-return-data-in-react-application/6176>\
**Category:** Client SDKs\
**Tags:** client, web\
**Created:** [April 21, 2023, 1:40pm UTC](https://community.apollographql.com/t/fragment-doesnt-return-data-in-react-application/6176 "2023-04-21T13:40:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![parithibang](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/parithibang/32/4214_2.png) [@parithibang](https://community.apollographql.com/u/parithibang)\
**Post date:** [April 21, 2023, 1:40pm UTC](https://community.apollographql.com/t/fragment-doesnt-return-data-in-react-application/6176/1 "2023-04-21T13:40:55Z")

</div>

I am using `"@apollo/client": "^3.7.10"` The data is visible in the network tab but can’t able to access it in the application.

Query:

```auto
const CREATED_BY = 
  fragment CreatedBy on Person {
        name
        jobTitle
        url
    }
;
const REVIEWED_BY = 
    fragment ReviewedBy on Person {
        name
        jobTitle
        url
    }
;
const getArticleQuery = (article: IArticleIdentifier) => ({
    document: 
${CREATED_BY}
${REVIEWED_BY}
query ArticleContentQuery($id: String!) {
    ${article.type}(where: { id: $id }) {
        text(urlKind: identifier)
        lastReviewed
        nextReviewed
        printableCopy
        headline
        version
        introduction
        creator {
            ...CreatedBy
        }
        reviewedBy {
            ...ReviewedBy
        }
        audience {
            audienceType
        }
        identifier(name: "MedicalAuthors") {
            value
        }
    }
}`,
    variables: { id: article.id },
});

```

This is apollo client object

```auto
const cache = new InMemoryCache({
    addTypename: false,
    possibleTypes: {
        Person: ["Person"],
    },
    typePolicies: {
        Query: {
            fields: {
                search: {
                    keyArgs: ["term", "audienceType", "type"],
                    // eslint-disable-next-line @typescript-eslint/default-param-last
                    merge(existing = { results: [] }, incoming) {
                        return { ...incoming, results: existing.results.concat(incoming.results) };
                    },
                },
            },
        },
    },
});

const useApolloClient = (accessToken?: string): ApolloClient<any> => {
    return new ApolloClient({
        link: authMiddleware(accessToken).concat(httpLink),
        cache,
    });
};

```

---

<div class="post-metadata">

**Author:** ![lenz](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/lenz/32/4007_2.png) [@lenz](https://community.apollographql.com/u/lenz)\
**Post date:** [April 21, 2023, 1:43pm UTC](https://community.apollographql.com/t/fragment-doesnt-return-data-in-react-application/6176/2 "2023-04-21T13:43:48Z")

</div>

Hi [parithibang](https://community.apollographql.com/u/parithibang), as already mentioned over in your GitHub issue: please provide a runnable reproduction of this. It is very hard to help you based on partial code and screenshots.

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:49pm UTC](https://community.apollographql.com/t/fragment-doesnt-return-data-in-react-application/6176/3 "2025-02-06T20:49:03Z")

</div>

Archived on February 6, 2025, 8:49pm UTC


