title: GraphQL type Nesting and cyclic Dependenciies on Types
body: <p>here i have 3 Types</p>
  
  <p><strong>JobType</strong></p>
  
  <p><strong>EmployerType</strong></p>
  
  <p><strong>SeekerType</strong></p>
  
  <p>A <code>job</code> will have only one <code>Employer</code> who created it</p>
  
  <pre><code>const JobsType = new GraphQLObjectType({
      name: 'JobsType',
      fields: {
          jobsId: {
              type: GraphQLID,
              resolve: obj =&gt; obj._id,
          },
          title: { type: GraphQLString },
          description: { type: GraphQLString },
          experience: { type: GraphQLString },
          position: { type: GraphQLString },
          openings: { type: GraphQLInt },
          employer: {
              type: EmployerType
              resolve: () =&gt; // somedata here
          }
      },
  });
  </code></pre>
  
  <p>An <code>Employer</code> can create multiple <code>jobs</code> so </p>
  
  <pre><code>const EmployerType = new GraphQLObjectType({
      name: 'EmployerType',
      fields: {
          userId: {
              type: GraphQLID,
              resolve: obj =&gt; obj._id,
          },
          company: { type: GraphQLString },
          email: { type: GraphQLString },
          password: { type: GraphQLString },
          industry: { type: ENUM.IndustryType },
          ownerShip: { type: ENUM.OwnerShipType },
          website: { type: GraphQLString },
          jobs: {
              type: JobsType,
              resolve: (obj) =&gt; // some data to resolve
          }
      },
  });
  </code></pre>
  
  <p>A <code>seeker</code> can apply to many <code>jobs</code> so,</p>
  
  <pre><code>const SeekerType = new GraphQLObjectType({
      name: 'SeekerType',
      fields: {
          userId: {
              type: GraphQLID,
              resolve: obj =&gt; obj._id,
          },
          email: { type: GraphQLString },
          password: { type: GraphQLString },
          firstName: { type: GraphQLString },
          lastName: { type: GraphQLString },
          education: { type: GraphQLString },
          address: { type: GraphQLString },
          jobs: {
              type: JobsType,
              resolve: (obj) =&gt; // some data to resolve
          }
      },
  });
  </code></pre>
  
  <p>so here it seems to have multiple and cyclic dependencies on the <code>GraphQLObjectType</code> </p>
  
  <p><code>Jobs</code> contains <code>EmployerType</code>, and again <code>EmployerType</code> contains <code>jobs</code>, where as <code>job</code> have again <code>EmployerType</code></p>
  
  <p>so like this</p>
  
  <pre><code>{
      job {
          jobId,
          jobTitle,
          employer {
              userId,
              company,
              email,
              job {
                  jobId, 
                  jobTitle,
                  employer {
                      userId,
                      company,
                      email
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>this is not the correct way as the dependencies goes deeper and deeper</p>
  
  <p>same for <code>SeekerType</code> too</p>
  
  <pre><code>{
      seeker {
          userId,
          email,
          firstName,
          lastName,
          job {
              jobId,
              title,
              description,
              employer {
                  userId,
                  company,
                  email,
                  job {
                      jobId,
                      title,
                      employer {
                          userId,
                          company
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>what might the solution for this </p>