I'm facing a issue with query in GRAPHQL
Here is my query
const discussionform = gql`
query totara_mobile_discussion {
discussion {
__typename
us
sys
}
}
`;
I'm using react-hooks.
import { useQuery } from "@apollo/react-hooks";
const Profile = ({ navigation }: ProfileProps) => {
const { loading, data, error } = useQuery(discussionform);
if (loading) return <Loading testID={"test_ProfileLoading"} />;
return (
<View>
<Text>{data}</Text>
</View>
);
};
The error i'm getting
Missing field __typename in {
"us": "General news and announcements",
"sys": "tesr"
}
By adding the __typename in the schema in serverside the issue will be resolved.