Let G be a groupoid and assume that (A(p))(p is an element of G) is a family of algebras with identity. First, we introduce the notion of a weak Hopf (groupoid)G-coalgebra by that if, for each pair p,q is an element of G, there is given a unital homomorphism Delta(p,q) : A(pq) -> A(p)circle times A(q) satisfying certain properties, generalizing the notion of Hopf group-coalgebras as introduced by Turaev from groups to groupoids and Hopf algebra structures to weak Hopf algebra structures. Then one considers now the direct sum A =circle plus(p is an element of G)A(p) of these algebras. It is an algebra, without identity, except when G is a finite groupoid, but the product is non-degenerate. The maps Delta(p,q) can be used to define a coproduct Delta on A and the conditions imposed on these maps give that (A, Delta) is a weak multiplier Hopf algebra. It is G-cograded as explained in this paper. We study these so-called groupoid-cograded weak multiplier Hopf algebras. They are, as explained above, more general than the weak Hopf group-coalgebras (introduced by Van Daele and Wang), generalizing the Turaev's Hopf group-coalgebras. Moreover, our point of view makes it possible to use results and techniques from the theory of weak multiplier Hopf algebras in the study of weak Hopf groupoid-coalgebras (and generalizations).