We visited a toy store and my 1-year-old daughter showed great interest in a doll and I bought it for her.
It is wrong to buy whatever a child wants, and I am wondering how to define the difference between "I buy her a toy" and "I am spoiling her."
It's a good idea to restrict toy buying to particular times of the year, like birthdays, or Christmas, or whatever other holidays are meaningful to you and your family.
This will help teach your child self-control and patience, and help them to value the things they already have.
At 1 year old, I would say the problem is not yet too bad, but if you do this sort of thing when she is 2 or 3, it will become a big problem.
If you don't set expectations early, then you will soon discover that you cannot get out of stores without her throwing screaming tantrums and demanding ever more extravagant toys. She'll play with them for a day or two until she sees something more exciting, and then demand that.
At one year old, the concern isn't so much her, as your habits. She's not going to really understand the idea of limitations on toys yet; the toys appear and she's happy. Even the concept of ownership is pretty far away. Buying her something that she shows interest in is a good thing; her interest may point to something that she doesn't have at home that she'd like to develop, such as social skills.
The question is you getting into good habits. When she's three or four, how are you going to handle toys then? How do you want to set things up so that you're buying within acceptable budgetary limits, and are teaching the concept of scarcity to your child?
I disagree with another answer above that buying only at special occasions is the right strategy, though that's certainly a reasonable one. I don't like the "big piles of gifts" (or even "small piles") concept; spreading it out more over time will make sure you end up with more overall utility. But that's one strategy, and certainly one better than none.
The strategy that I prefer is an allowance for toys. We scale the allowance on age - as older kids realistically want more expensive toys - and then keep to that as best we can. (We still occasionally buy things outside of that budget, but we try to keep that to a minimum.) Once the children are old enough to make their own choices about toys, they get control over the allowance (with normal limits of course); until then, we make the choices. So a 1 year old we allocate maybe $1 a week on toys, for example. When she's two that goes up a bit, at three goes up a bit more, etc., based on your finances and preferences.
That not only helps us budget, but it also helps us teach our children budgeting and scarcity, and the idea of saving up (since they don't get enough in one week for the things they want). Getting into the habit when they were babies was helpful for us, though, too.
Having a good toy selection is good for the child; up to a point, having more toys gives the child more ways to stimulate her senses and learn different things. Especially now that she's probably mobile, being able to have many different toys in different locations gives her incentive to move around and investigate her environment.
The simple answer to what you've done- no.
Putting this into the greater framework of parenting in general though, I'd have to say that the response would be to, as @User1751825 has said- restrictions should be in place.
Ultimately as a parent what you do is entirely down to you- but the general "common" belief is that the occasional treat, if for a purpose other than "just because" doesn't hurt and can be a motivational factor to influence children's development that good behaviour or performing in a certain way will lead to "perks" or positive reinforcement.
This can be something like saying that if they behave at school and home all week, on the weekend you'll do something together or go to a shop and buy something up to a monetary value of "X", with longer-term rolling benefits of if they do well to get a bigger reward.
However, there are downsides to this as evidenced in some TV shows (supernanny for example) that showed a Mother buying her young (roughly 6 yr old) daughter chocolate each week if she did well- but the reward was, after some months, no longer enjoyed and so the daughter ended up with a literal pile of chocolate which she didn't want and so began to slide back into bad habits that this process was meant to curtail.
The term of "spoiling" would only apply if you were to, upon the whims of the child buy them everything or most things they want, when they want it- be it food, toys or otherwise. Depending on the frequency of this, it could potentially impact their development to some degree- for example despite behaviour and/or performance at home/school (or otherwise) that they'll get whatever they want still.
It's a different situation for every parent with their children- where do you draw the line of buying them things they'd like and getting them something because you want to? The interpretations from both sides are difficult to always determine but nobody wants their child to be seen as a "spoiled brat", but by the same token don't want their child to be viewed as being worse off as a result.