cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

I'm having issues with long loading times in my GRANDstack app

Hi everyone I've been coding for a few months and this is my first attempt at a web app using GRANDstack. I'm extremely new to all this so forgive the janky looking website. I created the design and everything by myself, attempting to build something for my church.

I've built my app here using grandstack and I've been having issues with long loading times. Could anyone help with some suggestions of what to do to shorten the loading times in my web app?

John-Dag
3 REPLIES 3

MuddyBootsCode
Graph Steward

Can you provide some code snippets here for the types of queries you're using? That might help us give you some advice.

Alright. So here is one of my more complex GraphQL queries. I don't know so much about this as I'm fairly new, I'm wondering if it's because of the volume of date I am requesting from this query?

export const DISPLAY_MEMBER = gql`
  query displayMember($id: ID) {
    displayMember(id: $id) {
      id
      firstName
      lastName
      email
      phoneNumber
      whatsappNumber
      pictureUrl
      gender {
        gender
      }
      maritalStatus {
        status
      }
      dob {
        date {
          formatted
          day
          month
          year
        }
      }
      bacenta {
        name
        leader {
          firstName
          lastName
        }
        centre {
          name
          town {
            name
            bishop {
              firstName
              lastName
            }
          }
          campus {
            name
            bishop {
              firstName
              lastName
            }
          }
        }
      }
      ministry {
        id
        name
        leader {
          firstName
          lastName
        }
      }
      occupation {
        occupation
      }
      title {
        Title {
          title
        }
        yearAppointed {
          year
        }
      }
      history {
        timeStamp {
          hour
          minute
        }
        created_at {
          date {
            formatted
          }
        }
        loggedBy {
          id
          firstName
          lastName
        }
        historyRecord
      }
      leadsBacenta {
        id
        name
        leader {
          firstName
          lastName
        }
        centre {
          id
          name
          town {
            name
            bishop {
              firstName
              lastName
            }
          }
          campus {
            id
            name
            bishop {
              firstName
              lastName
            }
          }
        }
      }
      leadsCentre {
        id
        name
        town {
          id
          name
          bishop {
            id
            firstName
            lastName
          }
        }
        campus {
          id
          name
          bishop {
            id
            firstName
            lastName
          }
        }
      }
      leadsTown {
        id
        name
        bishop {
          id
          firstName
          lastName
        }
      }
      leadsCampus {
        id
        name
        bishop {
          id
          firstName
          lastName
        }
      }
      leadsSonta {
        id
        name
      }
      leadsBasonta {
        id
        name
      }
      leadsMinistry {
        id
        name
      }
      townBishop {
        id
        name
      }
      campusBishop {
        id
        name
      }
    }
  }
John-Dag

William_Lyon
Graph Fellow

How many displayMember nodes are in the database? Do you have a database index on the id property of displayMember?

In general it's a good idea to create indexes in the database on any properties that you'll be using to look up nodes by property value (i.e. the starting point of the graph traversal).