Images Slice How to query in Component

Hello I am a new with prismic and already read the tutorial. I have a a problem to query slice images in component. My code looks like this

import React from "react";
import { graphql, useStaticQuery } from 'gatsby';

const ComponentOne = () => {
  const { wahlen } = useStaticQuery(graphql`
    query {
      wahlen: prismicHomePageWahlen {
    data {
      body {
        ... on PrismicHomePageWahlenBodyLinks {
          id
          items {
            city_link
            city_name
          }
        }
        ... on PrismicHomePageWahlenBodyImages {
          id
          items {
            slide_images {
              fluid(imgixParams: {maxHeight: 300}) {
                ...GatsbyPrismicImageFluid
              }
            }
          }
        }
      }
      subtitle {
        text
      }
      title {
        text
      }
    }
  }
    }
  `);

 
  return (
    <section>
      <div>
        <div className="row">
          <div className="col-lg-6">
             <h2>
              {wahlen.data.title.text}
          </h2>
            <div className="row">
             

            </div>
          </div>

          <div className="col-lg-6">
           <div >
 
            <div className="item">
              <div>
                <img src={team1} />
              </div>
            </div>
            <div className="item">
              <div>
                <img src={team1} />
              </div>
            </div>

        </div> 
            </div>

        </div>

        
      </div>
    </section>
  );
};


export default ComponentOne;

Can Anyone help me please with this issue. How can I query the images?
Thanks.

Hi there,

I'm not sure if the way you have implemented your components is the best way to do it, but I will debug this issue with you.

Meanwhile, you can have a look at the way we implement sliceZone components and how we supply the data to it and its components (slices.) here

Also, it would be great if you can share the name of your repository (in a private message if necessary).

Best,
Fares

Hello @Fares thanks for your reply. I have changed exactly like in documentation you mentioned about slices. 2 Slices are working fine. But third slice I cannot query again. Because I want to 2 slices in one slice file. Is that possible? If it is possible How can I success this?

Thanks.

Great, glad to here that you have been able to make the 2 slices to work.

And for the 3rd Slice file that you want to have 2 slices in it, can you tell us what is the use-case that you are trying to implement? can you share a code snippet with the new modifications.

This issue has been closed due to inactivity. Flag to reopen.