Blackwell, Justice.Kammerer Real Estate Holdings, LLC owns a lot on the corner of Peachtree Parkway and Stoney Point Road in Forsyth County. Seeking to construct an automotive service facility on that lot, Kammerer applied for a site development permit. The lot is subject to a zoning condition under the Forsyth County Unified Development Code that certain “open space” on the lot remain undeveloped. The Director of the Forsyth County Department of Planning and Community Development concluded that the proposed construction would not comply with this condition, and so, he refused to issue a site development permit. Kammerer then asked the Forsyth County Board of Commissioners to amend the zoning condition, but the Board declined to do so. At that point, Kammerer filed this lawsuit against the County, the Board, and the Director, alleging that the Director had misconstrued the “open space” condition, and if it actually means what the Director said it means, it is unconstitutional in several respects. The defendants filed a motion to dismiss for failure to state a claim under OCGA § 9-11-12 (b) (6), and the trial court granted the motion in part and denied it in part. Kammerer appeals from the dismissal of certain claims, and the defendants cross-appeal from the refusal of the trial court to dismiss other claims. We affirm in part and reverse in part.1. In its pleadings, Kammerer sought declaratory relief concerning the constitutionality of the “open space” condition, as well as a writ of mandamus to compel the Director to issue the site development permit. The trial court dismissed these claims because it concluded that Kammerer lacks standing to assert the unconstitutionality of the zoning condition, inasmuch as the condition already was in effect when Kammerer acquired the lot. As the defendants now concede, this conclusion was in error. In City of Rome v. Pilgrim, 246 Ga. 281, 283 (2) (271 SE2d 189) (1980), this Court held that “the mere fact that a zoning regulation is in effect at the time property is purchased does not preclude the purchaser from attacking its constitutionality.” The trial court dismissed the claims for declaratory relief and a writ of mandamus upon a ground foreclosed by our decision in Pilgrim,[1] and we reverse the dismissal of those claims.[2]2. Kammerer sought judicial review of the decision of the Director to refuse a site development permit by writ of certiorari. The trial court dismissed this claim for judicial review, apparently based on its conclusion that Kammerer did not say much about the claim in its brief in response to the motion to dismiss.[3] Perhaps Kammerer could have defended this claim more forcefully, but that is not the test for dismissal under OCGA § 9-11-12 (b) (6). When presented with a motion to dismiss for failure to state a claim, a court must examine the sufficiency of the pleadings. See Anderson v. Flake, 267 Ga. 498, 501 (2) (480 SE2d 10) (1997).[4] In its amended pleading, Kammerer quite clearly complained that the Director had refused a site development permit based on his alleged misinterpretation of the “open space” zoning condition, and Kammerer sought “a writ of certiorari . . . for the correction of errors committed by . . . the [] Director.” The trial court dismissed the claim against the Director for judicial review by writ of certiorari upon an improper ground, and we reverse the dismissal of that claim.3. Kammerer also sought judicial review of the determination of the Board to leave the “open space” zoning condition in place by writ of certiorari. The Board moved to dismiss this claim for judicial review, but the trial court declined to dismiss it, reasoning that the Forsyth County zoning ordinance provides specifically that the acts of the Board in connection with zoning matters may be reviewed by writ of certiorari. Earlier this year, we held in City of Cumming v. Flowers, 300 Ga. 820, 823-824 (3) (797 SE2d 846) (2017), that the scope of review by writ of certiorari is defined by state law, see OCGA § 54-1, and its scope cannot be enlarged by local ordinance. That the zoning ordinance provides specifically for review by writ of certiorari is immaterial, and the trial court refused upon an improper ground to dismiss the claim against the Board for judicial review by writ of certiorari. Accordingly, we reverse the denial of the motion to dismiss this claim. On remand, the trial court should reconsider the motion to dismiss this claim in light of Flowers and OCGA § 5-4-1.4. Finally, Kammerer sought attorney fees under OCGA § 13-6-11, and the trial court refused to dismiss the claim for attorney fees. In their cross- appeal, the defendants note (correctly) that a claim for attorney fees under OCGA § 13-6-11 is a derivative claim, see Ga. Dept. of Corrections v. Couch, 295 Ga. 469, 474-475 (2) (a) (759 SE2d 804) (2014), and they urge that it cannot be brought as a claim derivative of a claim only for judicial review by writ of certiorari. That argument is understandable, considering that the trial court dismissed everything except the claims for certiorari review and attorney fees. But we have reversed the dismissal of the claims for declaratory and mandamus relief, and the parties have not briefed whether attorney fees are available under OCGA § 13-6-11 in connection with declaratory and mandamus relief.[5] Accordingly, at least for now, we cannot say that the trial court erred when it declined to dismiss the claim for attorney fees, and we affirm the denial of the motion to dismiss with respect to that claim.5. We do not decide definitively whether Kammerer states any claim upon which relief may properly be granted. We decide only that the trial court erroneously dismissed the claims for declaratory and mandamus relief by way of a legal analysis foreclosed by our decision in Pilgrim; erroneously dismissed the claim against the Director for judicial review by writ of certiorari by way of a misapplication of the proper standard for dismissal under OCGA § 9-11-12 (b) (6); erroneously denied dismissal of the claim against the Board for judicial review by writ of certiorari by way of a legal analysis inconsistent with our decision in Flowers; and did not err in rejecting the argument that the claim for attorney fees is due to be dismissed because it cannot properly be premised only on a claim for judicial review by certiorari (since other claims remain in the case, at least for now). Much is left to be resolved on remand. But based upon the particular rationales employed by the trial court below and the specific arguments of the parties on appeal, the judgment of the trial court on the motion to dismiss is affirmed in part and reversed in part.Judgment in Case No. S17A0924 reversed. Judgment in Case No. S17X0925 affirmed in part and reversed in part. All the Justices concur.