lexiconhq / lexicon

Built with Expo, React Native, and GraphQL, Lexicon is a pre-built mobile discussions app that you can customize for your users.
https://lexicon.is
MIT License
177 stars 31 forks source link

[about] Cannot return null for non-nullable field About.topicCount. #61

Closed biohackinginternational closed 3 months ago

biohackinginternational commented 6 months ago

Describe the bug

A clear and concise description of what the bug is. When using the application and clicking "Latest" or "Top"(only those), a new line shows in the output of the prose instance saying "[about] Cannot return null for non-nullable field About.topicCount."

REQUIRED: Include the contents of api/.env and frontend/.env

If you are manually overriding any environment variables when running the package scripts, include those as well.

api/.env

PROSE_DISCOURSE_HOST=https://forum.biohackinginternational.com

frontend/.env

No content

REQUIRED: answer the following questions:

To Reproduce

Steps to reproduce the behavior:

  1. Go to testflight
  2. Click on install
  3. Click on open
  4. Tap "Latest" or "Top"
  5. "[about] Cannot return null for non-nullable field About.topicCount." pops up in the output of the prose

Expected behavior

Upon clicking "Latest" or "Top" nothing should appear in the console.

Screenshots

If applicable, add screenshots to help explain your problem.

Screenshot 2023-12-09 at 1 17 58 PM

Environments

Desktop (please complete the following information):

Smartphone (please complete the following information):

GraphQL API (please complete the following information):

Please indicate where the Prose GraphQL API is running.

https://prose.biohackinginternational.com

Are you only running it locally on your development machine? Production

Have you deployed it somewhere? If so, what domain or IP address did you deploy it at? https://prose.biohackinginternational.com

How specifically did you configure the mobile app to connect to the API? Set proseUrl for everything in frontend/Config.ts to https://prose.biohackinginternational.com

Additional context

Add any other context about the problem here. All the content and stuff shows but still has those output in the logs, is this possibly tied with the notification issue?

starjustice commented 6 months ago

Hey @biohackinginternational, thanks for reporting this bug. The fix for this issue will be included in the next release. However, if you'd like to try fixing it yourself, you can navigate to the file api/src/resolvers/site/aboutQuery.ts.

Modify the code on line 14 to the following:

    let {
      data: {
        about: {
          stats: {
            topics_count: topicsCount,
            topic_count: topicCount,
            posts_count: postsCount,
            post_count: postCount,
          },
        },
      },
    } = await context.client.get(siteUrl);

    return {
      topicCount: topicCount || topicsCount,
      postCount: postCount || postsCount,
    };
Kinostrome commented 3 months ago

Hey @biohackinginternational, since it has been several months since we have heard from you about this issue, we will soon close it as resolved.

Please let us know if you have further questions.

Kinostrome commented 3 months ago

Closing this since we never heard back, and the issue should already be fixed in the latest release.